by Michael S. Kaplan, published on 2006/04/22 03:01 -04:00, original URI: http://blogs.msdn.com/b/michkap/archive/2006/04/22/580636.aspx
In the past I have had less than kind words to say about code pages 20127, 20269, and 1258. Well, with this post you will be able to add code page 864 to the list....
Over in the microsoft.public.platformsdk.mslayerforunicode newsgroup, shanab asked:
how i can encode from arabic(1256) to ibm(864) in c#.net?
i need help for this problem because i cannot encode and decode this.
Of course this question has nothing to do with MSLU, but it is common for people to see the word Unicode in the title and just post their question there. I think everyone is used to it. :-)
Now in theory, since both code pages exist on Windows you could just pivot them through Unicode -- a simple Encoding.GetEncoding(1256).GetString() to go from Windows code page 1256 to Unicode and a simple Encoding.GetEncoding(864).GetBytes() to go from Unicode to cp864.
If we take a slightly modified version of the code from this post and run it to get the list of characters in cp864, though (looking above 0x7f, of course!):
A quick glance of what cp864 supports explains why I talked about the ability to do this is something theoretical. :-)
The only Unicode code points in the regular Arabic block in Unicode are the numbers, which are incidentally not in cp1256. Everything else in cp864 is from the Arabic Presentation Forms, which are not characters you want to be using if you can help it, as I point out in It does not always pay to be compatible.
Even worse, it does not support all four forms of even the basic Arabic characters (no fault of the code page, it is a fault of all code pages since there is not enough room!).
So, the only real way to move between cp1256 and cp864 would be to write custom code to try to move into the presentation forms, and any time something is not supported I suppose just putting in the wrong form. Which would be a lot of work to support something that does not work very well anyway....
This post brought to you by "ﻱ" (U+fef1, a.k.a. ARABIC LETTER YEH ISOLATED FORM)
# Jhall5197 on 25 Apr 2006 12:17 PM:
# Michael S. Kaplan on 25 Apr 2006 12:39 PM:
Yuhong Bao on 18 Nov 2010 8:10 PM:
If you really need to use an OEM codepage for Arabic, there is codepage 720.
Yuhong Bao on 2 Nov 2012 2:25 AM:
864 also maps the ASCII percent sign to U+066A, which is for example used as an escape characters in URLs, which is why Mozilla want to remove support for it from Firefox:
2008/09/14 Johab to be kidding me!
go to newer or older post, or back to index or month or day