News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

text decoding

Started by mabdelouahab, March 22, 2016, 05:41:07 AM

Previous topic - Next topic

mabdelouahab

how to convert a text from Windows-1256 to Unicode? Any method or API function

Windows 1256

jj2007


mabdelouahab

Thank you jj2007 ; I forgot it  :P

Mikl__

Hi, mabdelouahab!
When I need to transfer the text from the Windows-1251 code to Unicode I use a macro du
du macro string
local bslash
bslash = 0
irpc c,<string>
if bslash eq 0
if '&c' eq "/"
        bslash = 1
elseif '&c'gt 127
db ('&c'- 0B0h),4
else
dw '&c'
endif
else
           bslash = 0
           if '&c' eq "n"
           DW 0Dh,0Ah
           elseif '&c' eq "/"
           dw '/'
           elseif '&c' eq "r"
           dw 0Dh
           elseif '&c' eq "l"
           dw 0Ah
           elseif '&c' eq "s"
           dw 20h
           elseif '&c' eq "c"
           dw 3Bh
           elseif '&c' eq "t"
           dw 9
   endif
endif
endm
dw 0
endm
for example wHello: du <Hello, world>