GPU..
GPU..

Reputation: 175

Console C# urdu writing not readable

i want to write on C# console in visual studio but it is not readable, only question mark is printed in space of each Urdu character.

Upvotes: 2

Views: 754

Answers (2)

Panagiotis Kanavos
Panagiotis Kanavos

Reputation: 131492

Unless you use a Unicode font, console applications will use the codepage defined by the machine's System locale. You can either change your system locale to one that supports Urdu or change the console's font to a Unicode font.

The '?' characters appear when Windows tries to display characters from one codepage using a codepage that has no corresponding characters for the original ASCII codes. Weird characters may appear when the target ASCII code exists but corresponds to a different glyph.

Upvotes: 2

Oded
Oded

Reputation: 499072

From Console.OutputEncoding Property on MSDN:

Note that successfully displaying Unicode characters to the console requires the following:

  • The console must use a TrueType font, such as Lucida Console or Consolas, to display characters.
  • A font used by the console must define the particular glyph or glyphs to be displayed. The console can take advantage of font linking to display glyphs from linked fonts if the base font does not contain a definition for that glyph.

Upvotes: 1

Related Questions