Jump to content

Weird problem comparing Hebrew characters


Go to solution Solved by pseakins,

Recommended Posts

Letter duos צ/ץ, מ/ם, נ/ן, כ/ך yield wrong TRUE/FALSE values when compared. Look at the code.

The duos do have meaning, but that's beside the point. I get wrong values half of the time. I tried to change the script encoding to UTF8, ANSI, UTF-BOM, still fail.

$c = "צ"
if $c = 'ץ' then
    MsgBox (0, "ץ", $c)
else
    MsgBox (0, "צ", $c)
EndIf
;Wrong

$c = "ץ"
if $c = 'ץ' then
    MsgBox (0, "ץ", $c)
else
    MsgBox (0, "צ", $c)
EndIf
;Right
if $c = 'צ' then
    MsgBox (0, "צ", $c)
else
    MsgBox (0, "ץ", $c)
EndIf
;Wrong again. The 1st comparison always generate TRUE regardless of letter from the duo צ/ץ
;Same problem with -  מ/ם, נ/ן, כ/ך
Edited by IlanMS
Adding encoding attempts
Link to comment
Share on other sites

  • Solution

I am not sure exactly why but it may work better if you use if $c == 'ץ' in your expression.

Double equals "==" is used for case sensitive comparisons and may be required here.

Edited by pseakins
original response was incorrect

Phil Seakins

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...