CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    Join Date
    Oct 2000
    Location
    Ottawa, CANADA. (CNADA ROCKS!!)
    Posts
    1,895

    change the codepage of a thread

    I have program where I create a thread to do some work. In the thread I do a _tsetlocale(LC_ALL, "tha_tha") for thai, OS is english. I'm still unable to read thai characters in theis thread. Any thoughts?

    Thanks in advance
    and Canada rocks!! Peace bro.

  2. #2
    Join Date
    Feb 2006
    Location
    Croatia - Zagreb
    Posts
    459

    Re: change the codepage of a thread

    Do you have actuall Thai font installed? If you have and it still wont work,
    maybe AppLocale can help you
    You just divided by zero, didn't you?

  3. #3
    Join Date
    Oct 2000
    Location
    Ottawa, CANADA. (CNADA ROCKS!!)
    Posts
    1,895

    Re: change the codepage of a thread

    Thanks, yes I have the eastern languages (including ) Thai installed.
    and Canada rocks!! Peace bro.

  4. #4
    Join Date
    Oct 2000
    Location
    Ottawa, CANADA. (CNADA ROCKS!!)
    Posts
    1,895

    Re: change the codepage of a thread

    I cant use applocale as this is a server based system and its in a dll.
    and Canada rocks!! Peace bro.

  5. #5
    Join Date
    Feb 2006
    Location
    Croatia - Zagreb
    Posts
    459

    Re: change the codepage of a thread

    So probably this is a system based problem and this is not the best forum for that kind of problems.
    You just divided by zero, didn't you?

  6. #6
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,633

    Re: change the codepage of a thread

    Quote Originally Posted by IndikaNiva
    I'm still unable to read thai characters
    Please explain that "unable to read" thing.
    Best regards,
    Igor

  7. #7
    Join Date
    Oct 2000
    Location
    Ottawa, CANADA. (CNADA ROCKS!!)
    Posts
    1,895

    Re: change the codepage of a thread

    ok lets simplify this

    Create a dummy dialog based application,
    add a simple edit control, add a variable of CString to that edit control

    Build the app in MB character set, try typing in the edit field in Thai keyboard. You get Junk characters.

    Build the app in unicode, everything is fine.

    But Thai (windows 874) is a ASCII character set. I'm I missing something here?

    Thanks.
    and Canada rocks!! Peace bro.

  8. #8
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: change the codepage of a thread

    The following link is an oldie, and some of the details no longer apply...but it does give a good background on what is happening behind the scenes (and why you DO want to use Unicode!)

    http://msdn.microsoft.com/en-us/magazine/cc301794.aspx
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  9. #9
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,633

    Re: change the codepage of a thread

    Quote Originally Posted by IndikaNiva
    Create a dummy dialog based application,
    add a simple edit control, add a variable of CString to that edit control

    Build the app in MB character set, try typing in the edit field in Thai keyboard. You get Junk characters.

    Build the app in unicode, everything is fine.

    But Thai (windows 874) is a ASCII character set. I'm I missing something here?
    Sure you are. You're missing the difference between CString and edit control. In addition, on some reason you think that thread locale matters somehow to edit box. While the system-wide locale setting only does.
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by Igor Vartanov; October 28th, 2008 at 02:24 PM.
    Best regards,
    Igor

  10. #10
    Join Date
    Oct 2000
    Location
    Ottawa, CANADA. (CNADA ROCKS!!)
    Posts
    1,895

    Re: change the codepage of a thread

    Thank you Igor,

    Long time no see!
    and Canada rocks!! Peace bro.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured