Why all my right to left letters have been corrupted

爱⌒轻易说出口 提交于 2019-12-11 08:45:53

问题


I have web application solutions , some pages contain arabic letters ,After moving the solutions to another pc , all the arabic letters converted to corrupted letters ,something like that :

ÈíÇäÇÊ ÇáØÇáÈ

How to fix this problem ?


回答1:


It's not corrupted. VS.NET based on the current culture of the OS (windows-1256), shows those letters correctly. If the regional settings of the new system is not configured for windows-1256, you will see the above letters. You have 2 options here:

  • Change the regional settings of the windows to Arabic (Windows-1256)

  • Or convert your files to UTF-8 with signature this way:

FixWindows1256

string data = File.ReadAllText(path, Encoding.GetEncoding("windows-1256"));  
File.WriteAllText(path, data, Encoding.UTF8);


来源:https://stackoverflow.com/questions/25504407/why-all-my-right-to-left-letters-have-been-corrupted

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!