Jump to content
  • Advertisement
Sign in to follow this  
Meshboy

Chinese chars!

This topic is 3553 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How can this become Chinese chars? I want European standard! pretty funny though... g_font->DrawText(NULL,(LPCWSTR)buffer,-,&font_rect,UNICODE,0xFFFFFFFF); //Color

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Meshboy
How can this become Chinese chars? I want European standard!
pretty funny though...

g_font->DrawText(NULL,(LPCWSTR)buffer,-,&font_rect,UNICODE,0xFFFFFFFF); //Color


At a wild ugess, I'd say it could be because your buffer contains chinese chars.
(Either that, or it contains other data, which can not be meaningfully cast to LPCWSTR)

To get useful answers, you might just have to provide a bit of information about your problem. Such as what you're calling DrawText with. (It also wouldn't hurt to specify what DrawText or g_font are. We can guess, of course, but you generally get better answers when you provide enough information to make an answer *possible*

Share this post


Link to post
Share on other sites
Without further info we can only guess:

buffer is an ascii string (char array), it didn't compile, so you simply pasted (LPCWSTR) in front of it.

Your project seems to use Unicode, tries to process the string as unicode and fails.

If your string is a literal (constant), you can put a L in front of it:

g_font->DrawText( NULL, L"Hello World, ... )


If not, you have to convert your ascii string to unicode with MultiByteToWideChar.


Or you can explicitely use the ascii version of DrawText (DrawTextA).

Share this post


Link to post
Share on other sites
Let me guess, you are using Visual C++? If so, go to project settings,configuration properties, and under project defaults you should see character set. Change it from Unicode to multi byte.

If you aren't using Visual C++, I cannot help you.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!