Unicode in CSV files

Q

Questioner

I am trying to save an excel file as a CSV file with unicode (Russian)
characters in column 1 and regular (English) characters in column 2. When I
save the file it says that data may be lost, and when I reopen the file the
Russian characters are nothing but question marks. Is there any way to save a
CSV file that will preserve my Russian characters?
 
J

Joel

The data may be in the file and you just can't see it. if you have a english
version of windows and open the CSV file with a text editor you won't see
russian becuse windows won't is trying to read the file in english and don't
understand the characters. but if you open the same file in a russian
version of Windows it will read the data. to see the russiian version you
would need to can a registry setting to russian instead of english. And then
the english characters won't be recognized.

If this is not the case you would need to write a macro to save the file.

Windows only recognizes characters between 0 - 255 ascii. The unicode
characters are greater than 256.

What application are you trying to put the data into? It may be possible to
copy and paste the data into another application. b Try copying the the data
into wro and you will get a two column Table.
 
Q

Questioner

Actually I am saving the file and re-opening it with excel. SO apparently it
is reading the characters with higher han 255 when I am putting it in, but
not reading them when I am opening to view the saved file?
 
J

Joel

Windows only accepts ascii character 0 - 255. Depending on the language
setting on the PC determines how the character map t a character. Digits are
universal with 30H - 39H (H is hexadecimal) representing the digits 0 - 9.
The letter A is 41H. For russian 41H is the 1st letter of the Russian
language.

When you use excel the Russian letters are treated as special characters
using unicode. They don't map to the the ascii character windows unless your
PC is russian. Then the Russian Character will in excel wil match to the
windows characters. This requires a registry setting changed on you r PC.
then you will have the same problem if you use English. windows cannot
support multi-language on the PC.
 
Q

Questioner

Why then do I have no problem saving and opening .xls files with both Russian
and English characters in them?
 
J

Joel

Windows doesn't recognize Unicode, xls does. A CSV file is just text.

You could develope you own custom format using a macro that will save
unicode data. The file would be a binary file. then you could also develope
a macro the will read the binary file back into excel. But it wuldn't be a
CSV file. You would use a different extension than CSV.
 

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

Top