Unicode character test cases
Posted: Wed Dec 03, 2008 9:22 pm
I am trying to run a test-case against a unicode character. For example:
if (mb_substr($text,1,0,"UTF-8") == [INSERT FOREIGN CHARACTER HERE] )
The problem is, I'm having trouble with the [INSERT FOREIGN CHARACTER HERE] part. Lets suppose I want the Arabic character ب, which according to Unicode 0628. Do I do "\u0628"? Do I do "\x0628"?
I tried: echo "\x0628"; but it atually echoed \x0628 instead of the Arabic character.
Any ideas on who a successful test-case with a unicode character would work?
if (mb_substr($text,1,0,"UTF-8") == [INSERT FOREIGN CHARACTER HERE] )
The problem is, I'm having trouble with the [INSERT FOREIGN CHARACTER HERE] part. Lets suppose I want the Arabic character ب, which according to Unicode 0628. Do I do "\u0628"? Do I do "\x0628"?
I tried: echo "\x0628"; but it atually echoed \x0628 instead of the Arabic character.
Any ideas on who a successful test-case with a unicode character would work?