0
string unicode = "\u0e23\u0e32";

How to convert \uXXXX\uXXXX to plain text by C#

Pagorn
  • 532
  • 1
  • 5
  • 25
  • 1
    I believe this will help : http://stackoverflow.com/questions/994459/getting-unicode-string-from-its-code-c-sharp – gideon Jul 15 '15 at 07:38
  • To which medium are you out putting? Many fonts will not include those code points, so you need to ensure the output method can specify a suitable font. – Richard Jul 15 '15 at 07:41
  • @gideon Both code points are in the BMP so UTF-32 will not be an issue. – Richard Jul 15 '15 at 07:41
  • [Joel Spolsky](http://joelonsoftware.com/articles/Unicode.html) has a really good artical for unicode. – Helix 88 Jul 15 '15 at 07:41
  • Guess I need to read that article. I'm doing that, nontheless, @Richard would you please elaborate what you mean. I'm clueless and curious. – gideon Jul 15 '15 at 07:43
  • @gideon These comments are far too short for a tutorial on Unicode encodings I'm afraid. Joel's article is a decent start. – Richard Jul 15 '15 at 07:44
  • @Richard yep. I'm on it. Thanks, after reading I'll figure out what you mean :) – gideon Jul 15 '15 at 07:46
  • If your language is Thai then use Codepage 10021. `string unicode = "\u0e23\u0e32";` `Encoding cp = Encoding.GetEncoding(10021);` `var result = cp.GetString(cp.GetBytes(unicode));` – GreenEyedAndy Jul 15 '15 at 07:57

0 Answers0