Why all my right to left letters have been corrupt

2019-08-04 15:12发布

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条回答
迷人小祖宗
2楼-- · 2019-08-04 15:42

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)

enter image description here

  • 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);
查看更多
登录 后发表回答