Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to see an Arabic letter on an edit box?

How to see an Arabic letter on an edit box?

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    iayd
    wrote on last edited by
    #1

    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

    M I 2 Replies Last reply
    0
    • I iayd

      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

      M Offline
      M Offline
      Matthew Faithfull
      wrote on last edited by
      #2

      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 of printf 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

      1 Reply Last reply
      0
      • I iayd

        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

        I Offline
        I Offline
        Iain Clarke Warrior Programmer
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups