I am trying to print Urdu sentence in C#. Let's say I have to print
10 apples, 20 oranges.
My expectation is, it should print (well, I can't even get it typed here):
Got this translation from Google Translate just to elaborate my query.
In C#, I've the Urdu strings for apples and oranges. Console.WriteLine() shows the format correctly, albeit with ????
So I see,
???? 20 ???? 10
However when I see the print preview, I see this instead: 10 سیب، 20 سنتری
I'm constructing the string by adding strings at the start of the string variable. However, it still displays incorrectly when printed.
Here is the sample code:
static void Main(string[] args)
{
string apples = "سیب،";
string oranges = "سنتری";
// Creating Urdu string for 10 apples, 20 oranges. Urdu is read from right to left. So created the string accordingly
string _10_apples_20_oranges = oranges + " 20 " + apples + " 10";
Console.WriteLine("output: " + _10_apples_20_oranges);
string[] lines = { _10_apples_20_oranges };
System.IO.File.WriteAllLines(@"test.doc", lines);
}
test.doc file contains سنتری 20 سیب، 10
This does not match the expected output given in the image above.
Any pointers would be really useful.
Thank you.