flat assembler
Message board for the users of flat assembler.

Index > Windows > MessageBoxW doesn't display the character 095h

Author
Thread Post new topic Reply to topic
yoshimitsu



Joined: 07 Jul 2011
Posts: 96
yoshimitsu 04 Jul 2013, 16:15
Hi,
I'm still very unfamiliar with unicode, so I don't know what's happening here:
Code:
include 'win32ax.inc'
.code
  start:
        invoke  MessageBox,HWND_DESKTOP,x1,NULL,MB_OK
        invoke  MessageBoxW,HWND_DESKTOP,x2,NULL,MB_OK
        invoke  ExitProcess,0
.data
        x1 db '•',0
        x2 du '•',0
.end start    

The second MessageBox seems to be empty, although I was expecting the same result.
Post 04 Jul 2013, 16:15
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1660
Location: Toronto, Canada
AsmGuru62 04 Jul 2013, 17:39
I see a square in a message box.
Maybe it depends on a default font Windows uses for message boxes?
Post 04 Jul 2013, 17:39
View user's profile Send private message Send e-mail Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6115
Location: Poland
MHajduk 04 Jul 2013, 19:08
yoshimitsu, this code should work for you:
Code:
include 'win32wx.inc'

include 'ENCODING\utf8.inc'
 
.code 
  start: 
        invoke  MessageBox,HWND_DESKTOP,x2,NULL,MB_OK 
        invoke  ExitProcess,0 
.data 
        x2 du '•',0 
.end start    
Post 04 Jul 2013, 19:08
View user's profile Send private message Visit poster's website Reply with quote
yoshimitsu



Joined: 07 Jul 2011
Posts: 96
yoshimitsu 04 Jul 2013, 22:06
MHajduk, thanks but it's still blank for me
I'm using win7 x64 btw.


Description:
Filesize: 12.21 KB
Viewed: 3318 Time(s)

Unbenannt.png


Post 04 Jul 2013, 22:06
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1660
Location: Toronto, Canada
AsmGuru62 05 Jul 2013, 01:35
Try like that:
Code:
x2 du 95h,0    
Post 05 Jul 2013, 01:35
View user's profile Send private message Send e-mail Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 05 Jul 2013, 06:11
AsmGuru62 wrote:
Try like that:
Code:
x2 du 95h,0    
That won't work because in Unicode BMP code points 0x00…0xFF follow precisely ISO/IEC 8859-1 (Latin-1) standard, where 0x80…0x9F range is allocated for control characters.

----8<----
yoshimitsu,

Bullet glyph corresponds to U+2022 code point. You may either use x2 du 0x2022, 0 or follow MHajduk's suggestion (crucial point is that you need editor with UTF-8 support to get proper source, i.e. • should be encoded as E2 80 A2 sequence; probably author forgot to indicate that).
Post 05 Jul 2013, 06:11
View user's profile Send private message Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6115
Location: Poland
MHajduk 05 Jul 2013, 09:03
baldr wrote:
yoshimitsu

(...) follow MHajduk's suggestion (crucial point is that you need editor with UTF-8 support to get proper source, i.e. • should be encoded as E2 80 A2 sequence; probably author forgot to indicate that).
Exactly, I use PSPad that supports UTF-8 encoding of the source but you may use any other more lightweight editor as for example Notepad++.
Post 05 Jul 2013, 09:03
View user's profile Send private message Visit poster's website Reply with quote
yoshimitsu



Joined: 07 Jul 2011
Posts: 96
yoshimitsu 05 Jul 2013, 10:32
Man, I srsly gotta search for some good Unicode tutorials to finally shed some light..
Thank you guys, I'm now using du 2022h.

PS: How do you actually know the correct code point?
Post 05 Jul 2013, 10:32
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4060
Location: vpcmpistri
bitRAKE 05 Jul 2013, 10:43
Character Map system tool in windows works - can search for "Bullet" and mouseover to get the code point in tooltip or status bar.
Post 05 Jul 2013, 10:43
View user's profile Send private message Visit poster's website Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 06 Jul 2013, 11:48
I usually query Google for an image-based database. One of them is here:
http://www.fileformat.info/info/unicode/char/2022/index.htm
I has more description than I can handle Smile
Post 06 Jul 2013, 11:48
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.