This site is no longer active and is available for archival purposes only. Registration and login is disabled.

unicode


unicode

Postby couderta » Jul 11, 2006 @ 9:42pm

couderta
pm Member
 
Posts: 4
Joined: Mar 6, 2006 @ 6:30pm


Postby InexorableTash » Jul 12, 2006 @ 7:14am

Windows Mobile builds must be Unicode anyway, so if you're building for WM you're already there - you just need to define UNICODE and _UNICODE in the desktop builds.

Otherwise:

Define UNICODE and _UNICODE
#include <tchar.h>
Wrap all string or character literals in TEXT()
Define all chars/strings as TCHAR instead of char

When you need to deal with non-Unicode APIs (e.g. to write to a text file), use WideCharToMultiByte() and MultiByteToWideChar() for conversions.

...and then fix the inevitable compile/runtime issues you see by correcting the assumptions you made (e.g. assuming sizeof(myString[0]) == 1)

Unless you're building for Win9x systems there's really no reason not to use Unicode and thus just use wchar_t and L"foo" everywhere instead of TCHAR and TEXT() but I like things which compile nicely regardless of the options.
User avatar
InexorableTash
pm Member
 
Posts: 99
Joined: Sep 13, 2002 @ 6:14am


Return to GapiDraw


Sort


Forum Description

The Cross-platform Graphics SDK for Palms, Pocket PCs, Symbian Devices, and Stationary PCs.

Moderators:

sponge, Johan

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron