写入文本文件时,用é代替©© [英] é instead of ã© while writing into the text file

查看:72
本文介绍了写入文本文件时,用é代替©©的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在创建用于文件处理的简单应用程序
当我在阅读像"SGSSociétéGénéralede Surveil验证"这样的文章时,我遇到了问题.
它正在写出"SGSSociétéGénéralede Surveill的验证"这样的输出行.
é正在转换为é...

我想写的是我正在读的是été"而不是éé"的

请帮助我解决此问题.



i m creating simple app for file processing
i m getting problem when i m reading line like this "Validation by SGS Société Générale de Surveil"
it is writing in out put line like "Validation by SGS Société Générale de Surveill"
é is converting to é ...

i want to write as it is what i m reading that is "été" but not "éé" insted

please help me to fix this

推荐答案

您的问题是什么?该输出看起来很完美,所有重音都可以.您对输出有什么期望?

请解释一下吗?

[添加的示例]

What is your issue? That output looks perfect all accents are OK. What are your expectations regarding the output?

Please explain?

[Added example]

public:

      String* filename = "your file name here";

      FileStream* fs = new FileStream(fileName, FileMode::CreateNew, FileAccess::Write, FileShare::None);
      StreamWriter* swFromFileStreamASCIIEnc = new System::IO::StreamWriter(fs, System::Text::Encoding::ASCII);

      swFromFileStreamDefaultEnc->Write("éé");
      swFromFileStreamDefaultEnc->Flush();
      swFromFileStreamDefaultEnc->Close();


就像编辑器和编译器正在使用不同的编码对待Unicode一样: Westren代码页,编译器将其读取为UTF8 .

检查文件保存设置和编译器选项,并使其一致.
Looks like the editor and the compiler are treating Unicode with different encoding: like "you save your source as extended ASCII with Westren codepage, and the compiler read it as UTF8".

Check the file save setting and the compiler options, and make them coherent.


这篇关于写入文本文件时,用é代替©©的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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