Discussion:
Concatenating strings in bidirectional systems (Hebrew language)
(too old to reply)
Sergio Trejo
2007-06-20 15:49:02 UTC
Permalink
I'm seeing a problem in VB 6.0 when concatenating strings that have Hebrew
characters and parenthesis.

Based on a login and user name we generate an output like "login (user
name)". For example: "strejo (Sergio Trejo)". We use a statement:

output = login & " (" & username & ")"

When the login and the user name are in Hebrew. The output parenthesis look
dissarranged. If I characterized the example above in Hebrew I would get the
following output: "ojerT oigreS) ojerts)".

It seems like the & operator recognizes the Hebrew strings and positions
first the user name and then the login. However, the parenthesis are not
positioned correctly in the output string.
Mark Yudkin
2007-06-20 17:17:22 UTC
Permalink
What happens is you convert the parenthesis characters with StrConv and an
LCID constructed from LANG_HEBREW?
Post by Sergio Trejo
I'm seeing a problem in VB 6.0 when concatenating strings that have Hebrew
characters and parenthesis.
Based on a login and user name we generate an output like "login (user
output = login & " (" & username & ")"
When the login and the user name are in Hebrew. The output parenthesis look
dissarranged. If I characterized the example above in Hebrew I would get the
following output: "ojerT oigreS) ojerts)".
It seems like the & operator recognizes the Hebrew strings and positions
first the user name and then the login. However, the parenthesis are not
positioned correctly in the output string.
Tony Proctor
2007-06-20 17:35:52 UTC
Permalink
As far as I know, the "&" operator is doing simple String concatenation, and
is not locale aware. This would make sense since it cannot possibly guess
what you're trying to achieve. I could be wrong but I though the
bidirectional aspect affected only the UI handling of text.

Could you confirm the character contents of your 'output' variable, e.g.

For i=1 To Len(output)
Debug.Print AscW(Mid$(output,i,1))
Next i

You might also consider re-posting the question in
microsoft.public.win32.programmer.international since there are more
specialised people watch that group

Tony Proctor
Post by Sergio Trejo
I'm seeing a problem in VB 6.0 when concatenating strings that have Hebrew
characters and parenthesis.
Based on a login and user name we generate an output like "login (user
output = login & " (" & username & ")"
When the login and the user name are in Hebrew. The output parenthesis look
dissarranged. If I characterized the example above in Hebrew I would get the
following output: "ojerT oigreS) ojerts)".
It seems like the & operator recognizes the Hebrew strings and positions
first the user name and then the login. However, the parenthesis are not
positioned correctly in the output string.
Loading...