Discussion:
list of files in a directory in unicode format
(too old to reply)
Maurice
2008-03-29 15:15:50 UTC
Permalink
Hello:

I would to get a list of files in a directrory, I tried: system("dir /s >
list.txt"); then I filtered and treated list.txt, it was ok.
Now there is some files'names in other national language (not latin
characters), how to
get a list of their names in unicode format for example? (in the previous
method, I got a question mark for each non latin character)

Thanks
Maurice
Ed Mulroy [TeamB]
2008-03-29 17:43:01 UTC
Permalink
The Windows API has the file search functions
FindFirstFile
FindNextFile
FindClose

You can look them up in the Windows API help.

The header files have macros to translate those names for ascii and unicode
applications, appending A or W respectively to the FindFirst* functions.

If you put
#define UNICODE
as the first line in the source file, before the include of windows.h, then
the headers will be expanded for unicode operations and the search functions
made into unicode ones.

. Ed
Post by Maurice
I would to get a list of files in a directrory, I tried: system("dir /s >
list.txt"); then I filtered and treated list.txt, it was ok.
Now there is some files'names in other national language (not latin
characters), how to
get a list of their names in unicode format for example? (in the previous
method, I got a question mark for each non latin character)
Loading...