2

My language is Persian and I use unicode UTF-8 to save pages. I transfer files from one system to another.Now I have problem with pages.I could not see text right.

Here is some code:

if (ClsTch.IsGradeLock)
     Gnr.AddCell(r, ClsTch.EvaluationFormList.GetStat().ScoreText);
else
     Gnr.AddCell(r, "ÈÓÊå äÔÏå");

How to fix it?

Sedighe Rahimi
  • 37
  • 2
  • 13
  • You cannot see the text right where? In your app? Or in visual studio? – Milney Apr 26 '17 at 11:45
  • You don't mean "characters in .NET" you mean "characters in the Visual Studio IDE". It's completely different. The former means the characters are showing up incorrectly in an application you've written...the latter means they're incorrect in the development environment. – rory.ap Apr 26 '17 at 11:46
  • @rory.ap you said right. – Sedighe Rahimi Apr 26 '17 at 11:55
  • @Milney In visual Studio – Sedighe Rahimi Apr 26 '17 at 11:56
  • JUST change the second windows language settings to Persian. – Inside Man Apr 26 '17 at 12:04
  • @Nofuzy Could You Please explain more Your solution? Because I Have Persian in The Language Bar. – Sedighe Rahimi Apr 26 '17 at 12:08
  • As far as I understand your problem, you can find solution by tools => Options => Tex Editor => General and check auto-detect utf-8 encoding without signature – Arkadiusz Raszeja Apr 26 '17 at 12:10
  • go to `Control Panel` -> `Region and Language` -> in `Format` tab change `Format` to `Persian` then in `Administrative` tab click on `change system locale` button and set it to `Persian`. Then Restart your system. – Inside Man Apr 26 '17 at 12:13
  • 1
    Pretty unusual in C#, seems like the file is missing the BOM. But then we can't tell if you used VS to create the file. Fixable with Notepad, File > Open > set Encoding = utf8 and select the file. Verify that the text now looks good. File > Save As > set encoding = utf8. And do check if whatever tool you used to create the file has an option to save with the BOM (aka "signature"), you'll need it. – Hans Passant Apr 26 '17 at 12:24
  • @HansPassant I'm also agree with you, it maybe the BOM. But Notepad++ will be easier than normal notepad ;) – Inside Man Apr 26 '17 at 12:28
  • @Nofuzy Your solution worked(Control Panel -> Region and Language -> in Format tab change Format to Persian then in Administrative tab click on change system locale button and set it to Persian. Then Restart your system).Thanks – Sedighe Rahimi Apr 26 '17 at 12:43
  • @Nofuzy put your solution in answer. – Sedighe Rahimi Apr 26 '17 at 12:45

1 Answers1

2

go to Control Panel -> Region and Language -> in Format tab, change Format to Persian; then in Administrative tab, click on change system locale button and set it to Persian. Then Restart your system.

Inside Man
  • 4,194
  • 12
  • 59
  • 119