Author Topic: Re: How to generate an Unicode string under MASM 6.15?  (Read 3807 times)

nidud

  • Member
  • *****
  • Posts: 1410
    • https://github.com/nidud/asmc
Re: Re: How to generate an Unicode string under MASM 6.15?
« Reply #30 on: May 07, 2017, 09:09:04 AM »
So this happens.

http://masm32.com/board/index.php?topic=5942.msg66207#msg66207

Code: [Select]
; Build: asmc /ws=866 /coff test.asm
; link /subsystem:console /libpath:\masm32\lib kernel32.lib user32.lib test.obj

.386
.model flat, stdcall

ExitProcess proto :dword
MessageBoxW proto :ptr, :ptr, :ptr, :dword

.code
start:
MessageBoxW( 0, "‡a£o«o¢oª", "‡a£o«o¢oª", 0 )
ExitProcess( 0 )

end start

aw27

  • Member
  • ****
  • Posts: 854
  • Let's Make ASM Great Again!
Re: Re: How to generate an Unicode string under MASM 6.15?
« Reply #31 on: May 07, 2017, 01:44:50 PM »
Sign of times, DOS prompt (Ok, let's call it command prompt) showing multilanguage Unicode.


« Last Edit: May 07, 2017, 03:22:47 PM by aw27 »

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 4930
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Re: How to generate an Unicode string under MASM 6.15?
« Reply #32 on: May 07, 2017, 01:48:41 PM »
Could you folks minimise the amount of image data being posted as attachments in the forum, it just loads up the server with a mountain of crap.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin:

aw27

  • Member
  • ****
  • Posts: 854
  • Let's Make ASM Great Again!
Re: Re: How to generate an Unicode string under MASM 6.15?
« Reply #33 on: May 07, 2017, 02:55:31 PM »
Could you folks minimise the amount of image data being posted as attachments in the forum, it just loads up the server with a mountain of crap.

I only posted one, not as attachment and not crap either.  :biggrin:
« Last Edit: May 07, 2017, 03:57:35 PM by aw27 »

jj2007

  • Member
  • *****
  • Posts: 7752
  • Assembler is fun ;-)
    • MasmBasic
Re: Re: How to generate an Unicode string under MASM 6.15?
« Reply #34 on: May 07, 2017, 06:18:55 PM »
Sign of times, DOS prompt (Ok, let's call it command prompt) showing multilanguage Unicode.

For me, only Russian works in the console. But some years ago I used to see Chinese and Arabic in the console, too, and I have no idea why that ceased to work. I've tried chcp 65001 and 65000, using Lucida Console and Consolas, etc, no success :(

aw27

  • Member
  • ****
  • Posts: 854
  • Let's Make ASM Great Again!
Re: Re: How to generate an Unicode string under MASM 6.15?
« Reply #35 on: May 07, 2017, 06:50:26 PM »
For me, only Russian works in the console. But some years ago I used to see Chinese and Arabic in the console, too, and I have no idea why that ceased to work. I've tried chcp 65001 and 65000, using Lucida Console and Consolas, etc, no success :(
I tested in Windows 10 using NSinSun or Gothic fonts. With the Windows 7 default fonts only Russian, but I think you can add fonts to the command prompt.

jj2007

  • Member
  • *****
  • Posts: 7752
  • Assembler is fun ;-)
    • MasmBasic
Re: Re: How to generate an Unicode string under MASM 6.15?
« Reply #36 on: May 07, 2017, 07:27:15 PM »
Could you folks minimise the amount of image data being posted as attachments

Point taken, Hutch. Most of my images are stored on my private site, though, and what I attach here is usually not that big.

Here is a nice one by Joel:

Quote
if you are a programmer working in 2003 and you don’t know the basics of characters, character sets, encodings, and Unicode, and I catch you, I’m going to punish you by making you peel onions for 6 months in a submarine. I swear I will.
...
Also they were liberal hippies in California who wanted to conserve (sneer). If they were Texans they wouldn’t have minded guzzling twice the number of bytes. But those Californian wimps couldn’t bear the idea of doubling the amount of storage it took for strings, and anyway, there were already all these doggone documents out there using various ANSI and DBCS character sets and who’s going to convert them all? Moi? For this reason alone most people decided to ignore Unicode for several years and in the meantime things got worse.

Thus was invented the brilliant concept of UTF-8 ... which has the nice property of also working respectably if you have the happy coincidence of English text and braindead programs that are completely unaware that there is anything other than ASCII.

With "braindead programs" he surely means ML.exe :P

TWell

  • Member
  • ****
  • Posts: 748
Re: Re: How to generate an Unicode string under MASM 6.15?
« Reply #37 on: May 07, 2017, 08:04:48 PM »
Could you folks minimise the amount of image data being posted as attachments in the forum, it just loads up the server with a mountain of crap.
OK.
I start removing my pictures and maybe later the whole profile  ;)

aw27

  • Member
  • ****
  • Posts: 854
  • Let's Make ASM Great Again!
Re: Re: How to generate an Unicode string under MASM 6.15?
« Reply #38 on: May 07, 2017, 08:07:03 PM »
With "braindead programs" he surely means ML.exe :P
Rewording, UTF8 allows programs built by code page 437 developers to stay alive in a changing World.

mineiro

  • Member
  • ***
  • Posts: 365
Re: Re: How to generate an Unicode string under MASM 6.15?
« Reply #39 on: May 07, 2017, 10:35:08 PM »
One common error for foreginers that is learn programming is about labels. As portuguese language point of view we can't create labels like "início" or "começo", and this is just "start" point. And student don't understand why he/she should write by removing accents, cedilla, ... .
This is hard because we can't create function names too.
I don't think this will change for a long time, so, plain english.
Would be nice if we can create function names, labels, variable names (not only data) by using unicode/utf-8/..., so we can inside same source code call a function writen on cyrilic, or arabic, ... . The hard part will be how to write that symbols by using keyboard.
Well, I don't have found a good solution to this, even if this works probably O.S. can refute that name.
I'd rather be this ambulant metamorphosis than to have that old opinion about everything

aw27

  • Member
  • ****
  • Posts: 854
  • Let's Make ASM Great Again!
Re: Re: How to generate an Unicode string under MASM 6.15?
« Reply #40 on: May 07, 2017, 11:23:18 PM »
One common error for foreginers that is learn programming is about labels.

Some compilers deal well with UTF8.
int Прощай()
{
   return 12;
}
int _tmain(int argc, _TCHAR* argv[])
{
   int início =  Прощай();
   int 好 = início;

   return 0;
}

aw27

  • Member
  • ****
  • Posts: 854
  • Let's Make ASM Great Again!
Re: Re: How to generate an Unicode string under MASM 6.15?
« Reply #41 on: May 07, 2017, 11:26:22 PM »

One common error for foreginers that is learn programming is about labels.

Some compilers deal well with UTF8.
int Прощай()
{
   return 12;
}
int _tmain(int argc, _TCHAR* argv[])
{
   int início =  Прощай();
   int 好 = início;

   return 0;
}

No assemblers, though.

mineiro

  • Member
  • ***
  • Posts: 365
Re: Re: How to generate an Unicode string under MASM 6.15?
« Reply #42 on: May 07, 2017, 11:41:50 PM »
thanks to reply sir aw27;
the only language that I can program is assembly; I have tried C for dummies and python too, but I learned more by simbiosys on source code, so I only posses noob knowledge about others languages.
Good know that some languages accepts utf-8. I was reading about that and sounds not much difficult to implement. One symbol on screen can have 1,2,3 or 4 bytes on memory, and they have absorbed ascii symbols.
https://tools.ietf.org/html/rfc3629

A bit offtopic but other thing is about 'new line' on source code. On windows this is crlf, on linux is only lf. A lot of assemblers fails here only looking for crlf.
I'd rather be this ambulant metamorphosis than to have that old opinion about everything

nidud

  • Member
  • *****
  • Posts: 1410
    • https://github.com/nidud/asmc
Re: Re: How to generate an Unicode string under MASM 6.15?
« Reply #43 on: May 07, 2017, 11:51:11 PM »
Hi mineiro,

One common error for foreginers that is learn programming is about labels. As portuguese language point of view we can't create labels like "início" or "começo", and this is just "start" point. And student don't understand why he/she should write by removing accents, cedilla, ... . This is hard because we can't create function names too.

This is not really a technical problem so this could be easily fixed, at least in the assembler. Data and comments do not have these restrictions.

Quote
I don't think this will change for a long time, so, plain english.

The Latin characters are not restricted to the English language  ;)

Quote
Would be nice if we can create function names, labels, variable names (not only data) by using unicode/utf-8/...,

You don't need Unicode/UTF for that: That's not the problem.

Quote
so we can inside same source code call a function writen on cyrilic, or arabic, ... .

And finally we get down to the real problem :t

Quote
The hard part will be how to write that symbols by using keyboard.

And the technical part of this line of thinking  :icon14:

Quote
Well, I don't have found a good solution to this, even if this works probably O.S. can refute that name.

Programming is a global language on it's own with global standards. Without these restrictions we would not be able to have this debate. Human languages do not have a global standard so that's a total different issue: DATA processed by programming converted to local time and languages.

mineiro

  • Member
  • ***
  • Posts: 365
Re: Re: How to generate an Unicode string under MASM 6.15?
« Reply #44 on: May 08, 2017, 12:39:53 AM »
hello sir nidud, thanks for reply;

The Latin characters are not restricted to the English language  ;)
Yes, I agree. Latin symbols don't have accents, cedilla, ... . This was created by french,spanish,portuguese,italian, german, maybe romaenian not sure...
When we turn computer on, symbols that we can see on screen are just data stored on bios to be put on screen. One chip factory created another symbol table and others the same. This is why they have created ascii symbols, to be a default between symbols (data).

Quote
You don't need Unicode/UTF for that: That's not the problem.
I was thinking about:
início:
The letter 'í' have accent, this letter if correct codepage setup shows as before, if other codepage is selected then I can see russian symbols or others chars, and we are talking about same hexadecimal representation. I have failed with some assemblers to write that label on source code because they cut the ascii table to latin chars or the first 127 symbols. So I'm judging that this can happen too with russians or others languages.

-edited-
I was thinking too on math symbols. Instead of "call sum" function we can call sigma "call Σ". So, while learning a math book, a student can find that symbol on a function form on computers.
I'd rather be this ambulant metamorphosis than to have that old opinion about everything