且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在VC ++中找到UTF-8的文本文件编码格式

更新时间:2023-02-20 10:39:12



MultiByteToWideChar()可以解决问题..

干杯
Hi,

MultiByteToWideChar() will do the trick..

Cheers


如果要在UTF-8编码文件中进行文本搜索,请

首先将文件读入字节数组的缓冲区

然后将缓冲区转换为宽字符数组

然后最后在宽字符串中搜索所需的文本
If you want to do text search in UTF-8 Encoded File then

First read the file into buffer of byte array

Then Convert the buffer into wide character array

then finally search into that wide character string for your desired text


UTF-8 一种文本文件编码格式.您到底想达到什么目的?
UTF-8 is a text file encoding format. What exactly are you trying to achieve?