Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello guys
I want to print european digits in computers with locale set to arabic. When I put NODS and NADS before and after the string containing the number, They are printed as ordinary character. my printer is microsoft xps document writer. when I use ETO_NUMERICSLATIN with ExtTextOutW, It does not work and arabic digits are printed.
I use ExtTextOut as this:
C++
int done = ExtTextOutW( hDC, x, y, ETO_NUMERICSLATIN, NULL, L"1234567890", 10, NULL );
Any suggestions apreciated
thanks in advance
mr.abzadeh

Edit:
MSDN calls U+30 th U+39 as Nominal or European digits and U+660 to U+66F as Indu-Arabic, which in arabic locale is National digit shaping. I want to get European digit shapes on paper, but I get Indu-arabic. I want to bypass digit translation.
mr.abzadeh

Edit:
I found that the problem was with my Windows and XPS printer, may be damaged. By Installing original Windows 7 on my laptop, Every thing worked properly, Sorry for the question.
mr.abzadeh
Posted
Updated 22-May-13 8:05am
v4

1 solution

"European digits" (1234567890) are actually called "Arabic digits" in Europe and New World, and there are also older "Hindu-Arabic numerals" or "Indo-Arabic numerals", they became "European" when Arabs introduced them in Europe. Presently, both systems are represented by separate different sets of characters. Please see:
http://en.wikipedia.org/wiki/Arabic_numerals[^],
http://en.wikipedia.org/wiki/History_of_the_Hindu%E2%80%93Arabic_numeral_system[^].

This is how it is presently standardized:
http://www.unicode.org/charts/[^],
http://www.unicode.org/charts/PDF/U0600.pdf[^].

If you don't use Unicode, you can only use "Arabic digits" ("European"), as they are in ASCII and are always there, no matter what happens. In Unicode, you can use both kinds of digits, as well as anything at all; all those characters have different code points. The problem is simply not a problem.

And the "locale" simply does not matter.

—SA
 
Share this answer
 
v2
Comments
Maciej Los 21-May-13 16:45pm    
+5
Sergey Alexandrovich Kryukov 21-May-13 16:56pm    
Thank you, Maciej.
—SA
mr.abzadeh 21-May-13 23:44pm    
Thanks for your reply. The links you showed me is about unicode specifications and code points. I have no problem with unicode and code points, My problem is this: Windows translates digits '0123456789' (MSDN calls them european digits) to "٠١٢٣٤٥٦٧٨٩" (MSDN calls them Indu-Arabic digits, U+0660 thru U+0669 0r U+06F0 thru U+06F9) and on paper I get Indu-Arabic digit shapes. Acording to MSDN, Pinting NODS (U+206F) before printing european digits should bypass this translation and print European digit shapes (U+30 thru U+39), which does not. and the following code should print European digit shapes, which does not.
int done = ExtTextOutW( hDC, x, y, ETO_NUMERICSLATIN, NULL, L"1234567890", 10, NULL );
As you see, I use unicode libraries and pass european digits, but get indu-arabic shapes on paper. I want to get nominal digit shapes(U+30 to U+39) on paper. The links have no information about unicode libraries and bypassing translation of nominal digits to national digit shapes. My problem is still remaining.
Sergey Alexandrovich Kryukov 22-May-13 0:31am    
I think I did not what function did you call. Did you try ExTextOut (without "W")? How about TextOut? I would not understand that translation, would assume the OS locale has a bug or something...
—SA
mr.abzadeh 22-May-13 7:53am    
I Tested this two codes
//first example
wchar_t wszBufer[] = "?1234567890";
wszBuffer[0] = 0x206F;//NODS
int done = TextOutW( hDC, x, y, wszBufer, 11 );
//second example
int done = ExtTextOutW( hDC, x, y, ETO_NUMERICSLATIN, NULL, L"1234567890", 10, NULL );

in both examples, I expect to get "1234567890" on paper, but I get "١٢٣٤٥٦٧٨٩٠". Calling ExtTextOut makes no difference because my project is unicode and ExtTextOut translates to ExtTextOutW. I do not know what is the problem. May be my understanding of unicode NODS or ETO_NUMERICSLATIN is incorrect, as english is not my first language. Can you please check if my understanding is correct? that is: NODS and ETO_NUMERICSLATIN should print nominal digit shapes even in non european locale?
thanks sergey
mr.abzadeh

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900