Why is this true: chr(254) = "th"

  • Thread starter Thread starter Guest
  • Start date Start date
Zorpie,
I suspect because under Windows Control Panel you have a region selected
where the ANSI code page maps Chr(254) to a character that maps to th. For
example in the US the code page is normally "Western European (Windows)",
which causes Chr(254) maps to the Latin Small Letter Thorn þ, If you have
Option Compare Text, "þ" = "th", while if you have Option Compare Binary "þ"
<> "th".

What does the following print?

Debug.WriteLine(AscW(Chr(254)), "254")

For characters over 127, I normally use the Unicode value & ChrW rather then
Chr which uses your Windows ANSI code page value.

Hope this helps
Jay

| This evaluates to true, why?
|
| chr(254) = "th"
|
| --
| --Zorpie
 
Jay B. Harlow said:
Zorpie,
I suspect because under Windows Control Panel you have a region selected
where the ANSI code page maps Chr(254) to a character that maps to th. For
example in the US the code page is normally "Western European (Windows)",
which causes Chr(254) maps to the Latin Small Letter Thorn þ, If you have
Option Compare Text, "þ" = "th", while if you have Option Compare Binary
"þ"
<> "th".

What does the following print?

Debug.WriteLine(AscW(Chr(254)), "254")

For characters over 127, I normally use the Unicode value & ChrW rather
then
Chr which uses your Windows ANSI code page value.

Hope this helps
Jay

| This evaluates to true, why?
|
| chr(254) = "th"
|
| --
| --Zorpie

I learn something new every day.

Mythran
 
Zorpiedoman,

In addition as well on this thread.
See my answer on your follow up question about code pages.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top