News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

Recent posts

#1
Assembly discussions / Re: Unicode strings in Assembl...
Last post by LeraUnu - Today at 01:29:26 PM
Hi Michele,
QuoteIt seems that the assembler doesnt' encode properly the unicode text strings.
Replacing the special unicode characters with their respective hex values it works
Yes I think that ...

Hi Vortex,
Quotemsg   dw 'This a UNICODE test '
      INCBIN "UnicodeText.txt"
      dw 0
Nice trick!

I hope that Pelle will fix the diacritics encoding in POASM in the future.

Thank you all for your kind help!

P.S.
I attach here the unicode version of Vortex's "SimpleWnd32" example with some diacritics and INCBIN.
#2
Assembly discussions / Re: Unicode strings in Assembl...
Last post by Vortex - Today at 12:28:15 PM
Hi LeraUnu and Michele,

Thanks for your tests. Here is a practical solution, a workaround with Poasm's statement INCBIN :

.386
.model flat,stdcall
option casemap:none

MessageBoxW PROTO :DWORD,:DWORD,:DWORD,:DWORD
MessageBox TEXTEQU <MessageBoxW>

ExitProcess PROTO :DWORD
.data

title dw 'UnicodeTest',0
msg   dw 'This a UNICODE test '
      INCBIN "UnicodeText.txt"
      dw 0

.code

start:

      invoke MessageBox,0,ADDR msg,ADDR title,0
      invoke ExitProcess,0

END start

UnicodeText.txt :

ă î ș ț
#3
Assembly discussions / Re: Unicode strings in Assembl...
Last post by Michele - Yesterday at 09:10:38 PM
Quote from: Vortex on Yesterday at 12:06:24 PMHi LeraUnu,

Thanks, your example works fine but my Poasm test is always failing.

- What is the version of your Pelles C setup? Mine is 13
- What's the encoding of your Pelles C editor? Mine is UTF16-LE

Could you check the attachment? I guess my source file cannot correctly encode those special characters.

It seems that the assembler doesnt' encode properly the unicode text strings.
Replacing the special unicode characters with their respective hex values it works.
#4
Assembly discussions / Re: Unicode strings in Assembl...
Last post by LeraUnu - Yesterday at 06:06:06 PM
Hi Vortex,

Thank you for testing.

PellesC version = 13
Encoding = UTF-16LE

I attach a text file with the Romanian characters and a modified object file (manually)
#5
Assembly discussions / Re: Unicode strings in Assembl...
Last post by Vortex - Yesterday at 12:06:24 PM
Hi LeraUnu,

Thanks, your example works fine but my Poasm test is always failing.

- What is the version of your Pelles C setup? Mine is 13
- What's the encoding of your Pelles C editor? Mine is UTF16-LE

Could you check the attachment? I guess my source file cannot correctly encode those special characters.
#6
Assembly discussions / Re: Unicode strings in Assembl...
Last post by LeraUnu - Yesterday at 07:27:51 AM
Hi Vortex,

Here is a small C project test. Please have a look.
#7
Assembly discussions / Re: Unicode strings in Assembl...
Last post by TimoVJL - July 04, 2025, 04:01:14 PM
I just analyzed things with pope.exe and TLPEView.exe
Just checking object file .data section, something is really wrong.
So use those tools to check how things went.
#8
Assembly discussions / Re: Unicode strings in Assembl...
Last post by Vortex - July 04, 2025, 03:27:32 PM
Hello LeraUnu,

Quoteset the encoding of the source files to UTF-16LE and everything is ok.

That didn't work for me. Tested with PellesC V13. I receive the uncorrect text display.
#9
Assembly discussions / Re: Unicode strings in Assembl...
Last post by LeraUnu - July 04, 2025, 03:13:01 PM
Hi TimoVJL,

Thank you for your answer.
Unfortunately I don't know how to generate an object file with the correct string.
In a C project I can define UNICODE and _UNICODE symbols, set the encoding of the source files to UTF-16LE and everything is ok.
In asm I don't know how ...
#10
Assembly discussions / Re: Unicode strings in Assembl...
Last post by TimoVJL - July 04, 2025, 07:50:48 AM
In UTF8 file
pFile      00 01 02 03 04 05 06 07  08 09 0A 0B 0C 0D 0E 0F    Value          
00000000    EF BB BF 6D 65 73 73 61  67 65 20 64 77 20 27 54    message dw 'T
00000010    68 69 73 20 61 20 55 4E  49 43 4F 44 45 20 74 65    his a UNICODE te
00000020    73 74 20 C4 83 2C 20 C3  A2 2C 20 C3 AE 2C 20 C8    st ă, â, î, È
00000030    99 2C 20 C8 9B 27 2C 30  0D 0A     ™, È›',0..
In UTF16 file
pFile      00 01 02 03 04 05 06 07  08 09 0A 0B 0C 0D 0E 0F    Value          
00000000    FF FE 6D 00 65 00 73 00  73 00 61 00 67 00 65 00    ÿþm.e.s.s.a.g.e.
00000010    20 00 64 00 77 00 20 00  27 00 54 00 68 00 69 00     .d.w. .'.T.h.i.
00000020    73 00 20 00 61 00 20 00  55 00 4E 00 49 00 43 00    s. .a. .U.N.I.C.
00000030    4F 00 44 00 45 00 20 00  74 00 65 00 73 00 74 00    O.D.E. .t.e.s.t.
00000040    20 00 03 01 2C 00 20 00  E2 00 2C 00 20 00 EE 00     ...,. .â.,. .î.
00000050    2C 00 20 00 19 02 2C 00  20 00 1B 02 27 00 2C 00    ,. ...,. ...'.,.
00000060    30 00 0D 00 0A 00     0.....
In object file
pFile      00 01 02 03 04 05 06 07  08 09 0A 0B 0C 0D 0E 0F    Value          
000000EB    48 00 65 00 6C 00 6C 00  6F 00 00 00 54 00 68 00    H.e.l.l.o...T.h.
000000FB    69 00 73 00 20 00 61 00  20 00 55 00 4E 00 49 00    i.s. .a. .U.N.I.
0000010B    43 00 4F 00 44 00 45 00  20 00 74 00 65 00 73 00    C.O.D.E. .t.e.s.
0000011B    74 00 20 00 C4 00 83 00  2C 00 20 00 C3 00 A2 00    t. .Ä.ƒ.,. .Ã.¢.
0000012B    2C 00 20 00 C3 00 AE 00  2C 00 20 00 C8 00 99 00    ,. .Ã.®.,. .È.™.
0000013B    2C 00 20 00 C8 00 9B 00  00 00     ,. .È.›...