-1

I have a problem. I want to rewrite txt file into other txt file, but with other encoding. I must implement conversion to Unicode, iso-8859 and windows-1250.

I must write it in c++. Can anyone help me with this topic? How to start coding this?

Best regards!

4

2 回答 2

1

Windows 完全有能力为您进行字符串转换。从源文件读取数据并将其传递给MultiByteToWideChar指定源代码页,然后将该输出传递给WideCharToMultiByte指定目标代码页并将该输出写入目标文件。

顺便说一句,下一个问题预先说明您仅在 Windows 上工作。不要将这样的有用信息放在评论中。

于 2014-01-04T23:36:44.050 回答
0

我将从深入了解这种编码格式开始,我会创建一些编码转换表,并逐字节转换。此外,听起来您将要处理不同的操作系统,因此请注意字节顺序。

这是一个很好的链接,可以帮助您开始为程序员编码

EDT#1:这是另一个关于windows 中字符编码主题的更深入的链接。在这里,您可以找到可以帮助您构建应用程序的函数和宏。

于 2014-01-04T18:10:15.597 回答