Groups | Blog | Home
all groups > dotnet internationalization > december 2004 >

dotnet internationalization : question about culture, TextBox, encoding


edisol50 NO[at]SPAM abv.bg
12/3/2004 12:42:16 AM
Hi,

I have this problem:
I have not unicode file which contains symbols with byte values from
0..255.
I want to copy this letters to a TextBox control. After that I check
the letters if they are in a given set (this is a String which
contains some ascii symbols from 0..255 from the file, in VS this
string is unicode and the codes of the symbols are not necessary
between 0..255). On my computer it works. On other computer with other
culture it doesn't work (synbols with codes >127 are changed). What
can I do my program to work correctly with different cultures?

Zoltan Sekeres
12/5/2004 5:05:46 PM
[quoted text, click to view]

So you seem to use different default codepages on your computers- not only
different cultures. All you have to do is to identify the encoding
(codepage) the file uses and specify it in your application when the file
is opened and read. The class

System.IO.StreamReader

for example has a constructor where you can specify the encoding.

--
zoltan
AddThis Social Bookmark Button