News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

How can I write Unicode version program?

Started by UMU, November 06, 2008, 02:20:48 AM

Previous topic - Next topic

hutch--

 :bg

Both of these views have the same problem, it treats the programmer like an idiot, having the actual choice of either ansi or unicode is something that a programmer can routinely decide, being strangled with a predefined either/or approach generates more problems than it solves.

> writing code like HLL.

This does not mean write MASM like a C compiler, the language does not need C based assumption to work, it is a language in its own right.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

jdoe

Quote from: hutch-- on November 11, 2008, 03:05:02 AM
Both of these views have the same problem, it treats the programmer like an idiot, having the actual choice of either ansi or unicode is something that a programmer can routinely decide, being strangled with a predefined either/or approach generates more problems than it solves.


It's not fair to say that I'm treating programmers as idiots but since I'm one of the most fervent of that way of handling Unicode (using a predefined value), I can assume your critics because for me, it did "solves more problems that it generates".

If my convictions make me looks like an idiot, I can live with it. It's not the first time and it won't be the last time... I'm used to    :bg

:U


hutch--

 :bg

JD,

I think something was lost in translation.

> If my convictions make me looks like an idiot, I can live with it. It's not the first time and it won't be the last time... I'm used to

We all suffer that one from time to time.

I was actually referring to the way the code/library/compiler designer(s) treat programmers with their assumptions, "users are idiots so we will patronise them". While I well understand a conditional assembly, following a C compiler with an either/or choice is not one that I see as a good choice as it is easy enough for the programmer to pick either form directly from the API name.

Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

jdoe


UMU

Quote from: hutch-- on November 10, 2008, 09:02:27 PM
Chris,

The virtue of not treating MASM like a C compiler is you can routinely mix ANSI and UNICODE Windows API functions without the limitations of a C compiler. The method used in the MASM32 project is intentional so you can use either by using the correct name of the function, it is by convention that the ANSI functions get the shortened name by using an equate.

The problem the user posted here is just one of the problems of aping a C compiler when an assembler never needed to do so.

I'd like to use MessageBoxW instead of MessageBox, but tell me how can I define a Unicode string in a stylish way. I need to use Simplified Chinese unicode string. thx!

hutch--

UMA,

While I don't have the specific chinese language experience, fortunately the resource string system in Windows will store the data in the form you need. What you need is a way to compose big 5 or whatever character set you use in a resource file script. Then you use the LoadStringW API function and display it as you choose.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php