C语言如何按行读取UNICODE文件?

C语言 码拜 9年前 (2015-05-12) 1358次浏览 0个评论

感觉在读取ANSI文件的时候fets函数不错,一次读取一行,如果读不完一行还会自动添加””\0″”,可是这个函数不能读取UNICODE文件,请问如何按行读取UNICODE文件?

10分
试试下面方法
http://zhidao.baidu.com/question/455981816.html
10分
磁盘上都是字节流,内存才会存在字符流。
使用fgetws
fgetws reads the wide-character argument str as a multibyte-character string or a wide-character string according to whether stream is opened in text mode or binary mode, respectively. For more information about using text and binary modes in Unicode and multibyte stream-I/O, see Text and Binary Mode File I/O and Unicode Stream I/O in Text and Binary Modes.


CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明C语言如何按行读取UNICODE文件?
喜欢 (0)
[1034331897@qq.com]
分享 (0)

文章评论已关闭!