Is there a tool available for Windows (command line, gui, script, etc.) that can recurse a directory and identify all files encoded as UTF-16?
|
feedback
|
migrated from stackoverflow.com May 5 '11 at 6:14
This question came from our site for professional and enthusiast programmers.
|
It would not be hard to make one, read the first two bytes of every file and see if they are set to FF FE (windows) respectively. | |||
|
feedback
|
|
A slow way would be to take any conversion utility and run it against all files in a directory. Those files converted successfully from UTF-16 to another format are most likely the ones you need. For that task you can pick an available tool like Character Set Converter. Or you can write such tool using C++ code snippet from this article Conversion between Unicode UTF-16 and UTF-8 in C++/Win32. Custom tool may be optimized to give up on first conversion error and not saving converted buffer into a file. | |||
|
feedback
|
0is a good start. – Joachim Sauer May 4 '11 at 15:37