Unicode wm caption

I am using msys to compile SDL 1.2.13 via

./configure --with-stdio-redirect=no
make
make install

How would I define the symbol ‘UNICODE’ in msys so that “SetWindowText” used in
"SDLsyswm.c" at line 225 is defined as “SetWindowTextW” instead of
"SetWindowTextA"?

Thanks!

Never mind, it seems now that it wouldn’t be that simple. I will have to hack the
source a little to get Unicode caption support.

Sam, can Unicode caption support be made as an optional compilation switch in a
future release?

Thanks again!

O duh, and HAPPY NEW YEAR!

Sam, can Unicode caption support be made as an optional compilation switch in a
future release?

In theory, you should always be giving SDL strings in UTF-8 encoding,
and it will deal with making them “Unicode” behind the scenes (or
dithering them to the correct codepage–or maybe just ‘?’ chars–for
win9x systems.

It’s possible that we don’t handle this correctly for window captions on
Win32, though and are using the “Ansi” win32 entry point…if that’s the
case, it’s a bug and we’ll fix it.

–ryan.

Ryan C. Gordon <icculus icculus.org> writes:

Sam, can Unicode caption support be made as an optional compilation switch in
a

future release?

In theory, you should always be giving SDL strings in UTF-8 encoding,
and it will deal with making them “Unicode” behind the scenes (or
dithering them to the correct codepage–or maybe just ‘?’ chars–for
win9x systems.

It’s possible that we don’t handle this correctly for window captions on
Win32, though and are using the “Ansi” win32 entry point…if that’s the
case, it’s a bug and we’ll fix it.

–ryan.

Hey Ryan. I think I might be using the ANSI win32 entry point because when I run
my application on Vista SDL converts all non ASCII UTF-8 characters into a ‘?’.
BTW is ANSI the default when building SDL via MinGW and Msys on Vista? If so, is
there an easy way switch to Unicode?

Thanks!
–Bill

Hey Ryan. I think I might be using the ANSI win32 entry point because when I run
my application on Vista SDL converts all non ASCII UTF-8 characters into a ‘?’.
BTW is ANSI the default when building SDL via MinGW and Msys on Vista? If so, is
there an easy way switch to Unicode?

Yep, add -DUNICODE to the command line.

SDL 1.3 is all unicode by default. :slight_smile:

See ya!
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment

Sam Lantinga <slouken devolution.com> writes:

Yep, add -DUNICODE to the command line.

SDL 1.3 is all unicode by default. :slight_smile:

See ya!
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment

Thanks Sam!

Thanks Sam!

You’re welcome! :slight_smile:

-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment

OK Just got back to my house to test it (I?ve been away for 4 days).

My new build commands are:
./configure CPPFLAGS=-DUNICODE --enable-stdio-redirect=no
make
make install

Apparently this doesn?t work :~(. It seems that SDL doesn?t check weather UNICODE
is defined internally for the Win32 target when compiling. This causes ASCII
strings to be passed where the Windows API is expecting UTF-16 strings, thus
causing the program to barf! I don?t think anyone will really need unlocalized
text in the title anyway, it was just something that I tested :~p. But hey if you
are willing to fix it that would be great :~)

Thanks for the help so far!
–Bill

My new build commands are:
./configure CPPFLAGS=-DUNICODE --enable-stdio-redirect=no
make
make install

Apparently this doesn???t work :~(. It seems that SDL doesn???t check weather UNICODE
is defined internally for the Win32 target when compiling. This causes ASCII
strings to be passed where the Windows API is expecting UTF-16 strings

Oh yes, there is that. :slight_smile:

You’ll just have to wait for SDL 1.3 then.

See ya!
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment