"Jon Skeet [C# MVP]" <skeet@pobox.comwrote in message
news:54772021-4a00-45a3-bb50-ef668a26e0ac@8g2000hse.googlegroups.com...
On Sep 12, 2:39 pm, "Paul W" <nos...@pw-review.comwrote:
<snip>
Quote:
See my response to Jon regarding the encoding. The reason I mention the
ANSI character set is because I have an editor that provides the character
codes for both OEM and ANSI. OEM shows the same character you are which is
then actually displayed as the square box. ANSI shows character 150 to be
the one actually in the file. This is all very confusing to me but I
believe I've got the correct encoding because the character code I'm
receiving is correct. I believe the problem is the character set. Is there
a way to switch between OEM and ANSI? Thanks for your help.
When you say "the character code I'm receiving is correct" what
*exactly* do you mean? If possible, provide a short but complete
example which demonstrates the problem. Obviously in this case *we*
won't be able to run the code because we don't have the file, but it
could still help a lot.
Jon
I don't think a sample of code would help here. What I mean by "the
character code I'm receiving is correct" is that the value of 150 that I
mentioned before is the correct value. In the ANSI character set, that
value maps to a character similar to a '-' and this character displays
exactly as expected in other text editors such as Notepad. However, in the
OEM character set, the character code 150 maps to something different
completely and ultimately is displayed as a square box just like all
unsupported characters are displayed in Windows.
I hope I'm making more sense now. The numeric value I'm receiving is the
correct one, the problem is that the character set, OEM, doesn't map that
value to an appropriate character. There are a couple of other characters
in the data files that do this as well. I don't remember the actual values
off hand though. If I could get my program to use the ANSI character set
instead of the OEM character set my problem would be solved.
Thanks again for taking the time to help me work through this problem.
--Paul