Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Ascii to HEX in Unicode fonts
Message
De
10/02/2014 06:04:56
 
 
À
10/02/2014 05:32:16
Reza Meamar
Homa Programming Group
Shiraz, Iran
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP3
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01593811
Message ID:
01593823
Vues:
39
>>>>>>>Dear All,
>>>>>>>I am using from Persian font. ( similar to Arabic )
>>>>>>>I need to calculate HEX value of each character of my string.
>>>>>>>So, ascii code of my character must be based on UNICODE.
>>>>>>>For example
>>>>>>>?asc(“م”) && Return 227 => HEX=E3
>>>>>>>
>>>>>>>But in Unicode, it must return 1605 => HEX=0645
>>>>>>>
>>>>>>>How I can do this conversion?
>>>>>>
>>>>>>try
>>>>>>
>>>>>>(1) Conversion from code page 1256 (arabic) to UTF-16 ( little endian)
>>>>>>
>>>>>>data =chr (227)
>>>>>>utf16 =Strconv(m.data , 5, 1256, 1)
>>>>>>
>>>>>>
>>>>>>If you want UTF-16 big endian, you'll have to reverse the bytes of utf16
>>>>>>(2) utf-16 to hex
>>>>>>
>>>>>>hex = strconv(utf16, 15)
>>>>>>?hex && 4506
>>>>>>
>>>>>
>>>>>Dear gregory,
>>>>>an error occurred in line
>>>>>utf16 =Strconv(m.data , 5, 1256, 1)
>>>>
>>>>What error ?
>>>
>>>in
>>>utf16 =Strconv(m.data , 5, 1256, 1)
>>>ERROR : TOO MANY ARGUMENTS.
>>>
>>>and if i changed to
>>>utf16 =Strconv(m.data , 5, 1256)
>>>ERROR : INVALID LOCALE ID.
>>>
>>>I am using from VFP7
>>
>>
>>I don't have vfp7 to test
>>
>>Try
>>
>>utf16 =Strconv(m.data , 5)
>>
>>
>>
>>or the function StringToUTF16() which uses api here message#1531792
>
>No. I can not use from StringToUTF16().
>Is it possible for you to summarize it for me?

Time to upgrade, before it's too late?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform