Board index » delphi » Hebrew && delphi && microsoft

Hebrew && delphi && microsoft

I need to scan string that has hebrew characters (hebrew - right to Left).

for example ;

For x:=1 to Legth(HebrewStr) do
  ShowMessage(copy(HebrewStr,x,1))

I see on the showmessage dialog the characters but not in the same orders i
excpected ,

What should i do ?

A

 

Re:Hebrew && delphi && microsoft


Quote
In article <3d258319_2@dnews>, "wowo" <d...@d.d> wrote:

> I need to scan string that has hebrew characters (hebrew - right to Left).

> for example ;

> For x:=1 to Legth(HebrewStr) do
>   ShowMessage(copy(HebrewStr,x,1))

> I see on the showmessage dialog the characters but not in the same orders i
> excpected ,

> What should i do ?

Start from the other end!
 For x:= Length(HebrewStr) downto 1 do
   ShowMessage(copy(HebrewStr,x,1))

Re:Hebrew && delphi && microsoft


Quote
In article <3d258319_2@dnews>, Wowo wrote:
> I need to scan string that has hebrew characters (hebrew - right to Left).

> for example ;

> For x:=1 to Legth(HebrewStr) do
>   ShowMessage(copy(HebrewStr,x,1))

> I see on the showmessage dialog the characters but not in the same orders i
> excpected ,
> What should i do ?

You failed to tell us in what order you *do* see the characters. I suspect
you just confuse the sequence characters are *stored* in a string with how
the are *displayed* on screen. The right-to-left issue only applies to the
display, not to the way the string is stored in memory. So HebrewStr[1]
should get you the character displayed the rightmost.

--
Peter Below (TeamB)  
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be

Re:Hebrew && delphi && microsoft


My purpose is to scan the string the way i see it ?
The problem start when string is mixed with hebrew and english so when i
start with english part its from left to right and when i strat the hebrew
part  from right to left.
The problem is more critical whe i need to add some hebrew string to mixed
char string - i did not find any logic where the additional string will be ,
sometimes its on the right and sometimes on the left.

A

Re:Hebrew && delphi && microsoft


Quote
In article <3d27ef28_1@dnews>, Wowo wrote:
> My purpose is to scan the string the way i see it ?

Well, they way you *read* it makes more sense. If you read the language from
right to left then the S[1] should be the character you read first, the
rightmost.  

Quote
> The problem start when string is mixed with hebrew and english so when i
> start with english part its from left to right and when i strat the hebrew
> part  from right to left.

I have to confess that i have no idea how Windows encodes Hebrew if you do not
use UNICODE strings (WideString). In a Widestring it would of course be
possible to mix characters from a left-to-right language with one from a
right-to-left language, but how those would be handled on display I don't
know.

There is a b.p.Delphi.internationalization group, perhaps someone there knows
how to deal with this problem. I cannot help you, sorry.
--
Peter Below (TeamB)  
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be

Other Threads