Filename encoding on XP

K

kent sin

What encoding does the NTFS store the filename?

I got some downloaded files, some with Chinese filename, I can not
backup them to CD because the name is not accepted.

I use walk, then print the filename, there are some ? in it, but some
Chinese characters were display with no problem. I suspect the
encoding of the filename is not unicode. How do I find out more about
this?
 
G

Guest

kent said:
What encoding does the NTFS store the filename?

In UTF-16LE. However, on-disk storage is mostly irrelevant, what
matters is what encoding is used on the OS API.

Windows has two forms of file API: Wide (Unicode) and ANSI
(byte-oriented). On NT, the Wide API is "native"; the ANSI API
converts strings forth and back (introducing ? if the conversion
fails).
I use walk, then print the filename, there are some ? in it, but some
Chinese characters were display with no problem. I suspect the
encoding of the filename is not unicode.

You need to pass a Unicode string into walk as the directory; then
recursively all results should also be Unicode strings.

Regards,
Martin
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,905
Latest member
Kristy_Poole

Latest Threads

Top