what is the best way to convert a UTF-16 files to UTF-8? I need to use this in a cmd script.
相关问题
- Inheritance impossible in Windows Runtime Componen
- how to get running process information in java?
- Is TWebBrowser dependant on IE version?
- How can I have a python script safely exit itself?
- I want to trace logs using a Macro multi parameter
相关文章
- 在vscode如何用code runner打开独立的控制台窗口,以及设置好调试模式时窗口的编码?
- 如何让cmd.exe 执行 UNICODE 文本格式的批处理?
- 怎么把Windows开机按钮通过修改注册表指向我自己的程序
- Warning : HTML 1300 Navigation occured?
- Bundling the Windows Mono runtime with an applicat
- Windows 8.1 How to fix this obsolete code?
- CosmosDB emulator can't start since port is al
- Spanish Characters in HTML Page Title
There is a GNU tool recode which you can also use on Windows. E.g.
An alternative to Ruby would be to write a small .NET program in C# (.NET 1.0 would be fine, although 2.0 would be simpler :) - it's a pretty trivial bit of code. Were you hoping to do it without any other applications at all? If you want a bit of code to do it, add a comment and I'll fill in the answer...
EDIT: Okay, this is without any kind of error checking, but...
Perhaps with iconv?
Certainly, the easiest way is to load the script into notepad, then save it again with the UTF-8 encoding. It's an option in the Save As dialog box..
If you have a ruby distribution installed, you can call a ruby script taking care of the conversion:
Ruby script to convert file(s) character encoding
In the same spirit: Perl script
In the absence of script support, you would have to code it like this C++ source using a WideCharToMultiByte() call...