i have a div where i dynamicly(with php) load text.
the thing is that this text might be hebrew and it will be displayed aligned to left.
what i mean is that it is pointless to set text direction for div because sometimes it will be left-to-right text and sometimes right-to-left text...
feyd:
i don't know whether the content is hebrew or english
Why not justify you text?
i tried it with no luck...in css docs it is said:
Conforming user agents may interpret the value 'justify' as 'left' or 'right', depending on whether the element's default writing direction is left-to-right or right-to-left, respectively.
- so it depends on what ua decides
Am I right in saying that you wish for text to be aligned in the position you wish?.
no i'm not forcing text to align to some specific position...
the text is inside <p>. that's all.
newmember wrote:Weirdan:
third picture(from top) is what i have but i want it to be like in the last picture
I believe you're talking about first and second pictures respectively (try to read them right to left, from what I know it's how hebrew texts should be read).
newmember wrote:
i can take a few characters,convert them to unicode and check whether they fall into hebrew range?
about pictures...
i wrote 3 and 4 picture....because i assumed that each english character is a hebrew letter...so in pictures 1 and 2 hebrew letters are mirrored...but forget it...
basicly what i have is that hebrew direction is ok but the text itself is aligned to left instead to right...so
Are you talking about visual align or text direction?
now i see that i'm talking about visual align
isn't them in unicode already?
mmm... sort of...
the strings are in UTF-8 and it is multibyte encoding for unicode codepoints.
so i need to take part from each byte of utf-8 character and convert/transform them to unicode 2 byte codepoint...
right?
either find or build a utf-8 analyzer that looks at the code pages the stream switches to.. count the number of characters in the pooled languages.. use that count to base your switch between left-to-right to right-to-left.