The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Farabi on October 27, 2008, 05:25:07 AM

Title: Unicode
Post by: Farabi on October 27, 2008, 05:25:07 AM
How much byte on unicode to represent a character? Can I use TextOut function to show a text?
Title: Re: Unicode
Post by: Renfield on October 28, 2008, 06:38:37 PM
Unicode utilizes wide characters which are 16-bit.  The appropriate API for these would be TextOutW.
Title: Re: Unicode
Post by: Vortex on October 28, 2008, 07:20:51 PM
Another function to display UNICODE strings is DrawTextW
Title: Re: Unicode
Post by: BogdanOntanu on October 28, 2008, 08:06:25 PM
Unicode itself uses many sizes for encoding one character. It can be 16 bits or 32 bits or 8 bits but with a variable size encoding like in UTF8. However Windows has a tendency to use "wide chars" that are 16 bits per char.

The above functions are correct. In addition many other Windows API have functions that end in "W" and those can be used with "wide" Unicode strings as parameters.