从UTF-8编码文件中读取字符 [英] Reading characters from UTF-8 Encoded File

查看:162
本文介绍了从UTF-8编码文件中读取字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试逐一读取Unicode(utf-8)文件中的字符,但是我不知道如何读取单个字符.那么,您能告诉我什么是读取单个字符的最简单方法吗?

I try to read one by one character in the Unicode (utf-8) file, but I don''t know how to read a single character. So can you tell me what is the easiest way to read a single character?

推荐答案

也许
Maybe this article will get you started in the right direction.


根据您使用的流类型,有几种选择,例如fgetcReadFilefstream.>>等.
There are several options depending on the type of stream you''re using like fgetc or ReadFile or fstream.>> etc.


在阅读了DrBones69上面引用的一篇不错的文章之后,您还可以使用此线程中的示例代码:
After reading a good article referenced above by DrBones69, you can also use sample code from this thread: Read unicode file into wstring[^]


这篇关于从UTF-8编码文件中读取字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆