如何从C ++文件中读取印地文文本? [英] how to read hindi text from a file in c++?

查看:90
本文介绍了如何从C ++文件中读取印地文文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
关于在Linux中使用C ++在印度语中进行文本处理

Possible Duplicate:
it about hindi text proccessing in in linux using c++

文件包含印地文文本.我想读取此文件并对包含的文本执行一些操作.因此,如果有人可以解释如何从文件读取和处理(或仅打印). 例如:如果文件包含

A file contains hindi text. I want to read this file and perform some operations on text it contains. So, if anyone could please explain how to read it from file and handle it(or just print it). Ex: if file contains

मैए로भ

然后我的程序应该从文件中读取此内容,并在标准输出上打印以上文本. 我想在Linux上执行它.

then my program should read this content from file and print above text on standard output. I want to perform it on Linux.

直接编码会更有益.

推荐答案

取决于编码.如果文件是用Unicode编码的,则只需使用广泛的ANSI C函数(fwscanffgetwc等),就可以读取任何语言的任何文件.

Depends on the encoding. If your file is encoded in Unicode, you just have to use wide ANSI C functions (fwscanf, fgetwc and so on) you will be able to read any file in any language.

这篇关于如何从C ++文件中读取印地文文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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