Q:

How to open Arabic text file with correct encoding in Visual Studio

I have a C# file that has some arabic text in it, I got the file from another source, the arabic text is now scrambled. looking like this ("ÇáãæÇÞÚ ÇáÞÇÈáÉ ááÊØæíÑ ÇáÓíÇÍì"), I tried to save the file in another encoding (UTF-8) but still same result, I desperately need to read this arabic text as this is the only back up we have
Thanks

A:

Try right-clicking the file in VS solution explorer, then choose:

Open With... -> CSharp Editor with Encoding

This should force VS to read the file with a unicode encoding, rather than as single byte text.
Although you are saving in UTF-8, the file may be missing the Byte Order Mark (BOM) for UTF-8 at the beginning of the file. A BOM for UTF-8 files is optional.
Update
If the file has no BOM, try:

... CSharp Editor with Encoding -> Unicode (UTF-8 without signature) codepage 65001

Update
The file is not unicode encoded, it requires opening with an Arabic codepage. Try opening as follows, or with one of the other Arabic codepages:

... CSharp Editor with Encoding -> Arabic (864) - Codepage 864

