How to see an Arabic letter on an edit box?
-
Hi all, I want to test that is my PDA supporting Arabic language? I wrote this code;
CString str; for(int i = 1500;i<1800;i++) { str.Format(\_T("%s %c"),str,i); } m\_edit.SetWindowText(str);
But I know that %c does not get 2 bytes.So it is getting the first Byte of an unicode and does not display an Arabic letter if the OS is supporting it.How can I see an Arabic letter? Thanks
-
Hi all, I want to test that is my PDA supporting Arabic language? I wrote this code;
CString str; for(int i = 1500;i<1800;i++) { str.Format(\_T("%s %c"),str,i); } m\_edit.SetWindowText(str);
But I know that %c does not get 2 bytes.So it is getting the first Byte of an unicode and does not display an Arabic letter if the OS is supporting it.How can I see an Arabic letter? Thanks
You could try just creating an array of WCHARs and intializing it with numeric values.
WCHAR aTestString[10] = { 1500, 1501, 1502, 1503, 1504, 1505, 1506, 1507, 1508, 1509, 1510, 0000 }; m_edit.SetWindowText( aTestString );
Not a way to test 300 characters but at least you should see whether it works without involving the comlpexities ofprintf
formating. I've implemented Arabic support on a WinCE application and it's far from simple partly because much of the Uniscribe API is unusably slow on a 200Mhz ARM processor."The secret of happiness is freedom, and the secret of freedom, courage." Thucydides (B.C. 460-400)
modified on Thursday, July 31, 2008 12:06 PM
-
Hi all, I want to test that is my PDA supporting Arabic language? I wrote this code;
CString str; for(int i = 1500;i<1800;i++) { str.Format(\_T("%s %c"),str,i); } m\_edit.SetWindowText(str);
But I know that %c does not get 2 bytes.So it is getting the first Byte of an unicode and does not display an Arabic letter if the OS is supporting it.How can I see an Arabic letter? Thanks
You already had an answer to displaying an arabic char - assuming you have the fonts etc etc. But I can't let the line
str.Format(_T("%s %c"),str,i);
be without jumping on it. You are trying to put the contents of str into str? At best this will crash, at worst it will do very strange things... If you are trying to add new characters to the end of your string, why not just do that? Or just build up a string yourself - it;s a fixed length.
A/
CString str;
for (wchar_t i = 1500; i < 1800; i++)
str += i;B/
wchar_t buf [301];
for (wchar_t i = 0; i < 300; i++)
buf [i] = i + 1500;
buf [i] = 0;The choice is yours. Iain.