comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » byte/unicode mismatch
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: byte/unicode mismatch [message #63841 is a reply to message #63772] Thu, 20 November 2008 11:08 Go to previous messageGo to previous message
Heinz Stege is currently offline  Heinz Stege
Messages: 189
Registered: January 2003
Senior Member
On Thu, 20 Nov 2008 09:23:52 -0800 (PST), mgalloy@gmail.com wrote:

> On Nov 20, 3:19�am, Reimar Bauer <R.Ba...@fz-juelich.de> wrote:
>> Hi
>>
>> the ascii table is gone.
>>
>> IDL> print,byte('�')
>> �195 188
>>
>> A char has now two bytes
>>
>> IDL> help, byte('�')
>> <Expression> � �BYTE � � �= Array[2]
>>
>> This means all of the fast string replacing routines which are related
>> to iso encoded ascii one byte characters are broken in 7.0
>>
>> What is the name of the function to convert byte('�') into 252b ?
>
> I guess it is how you type/enter the �:
>
> IDL> u = string(252B)
> IDL> print, u
> �
> IDL> help, u
> U STRING = '�'
> IDL> print, byte(u)
> 252
>
> Mike

Probably most readers here don't have an �-key on their keybord. So
here is another example:

IDL> print,!version
{ x86 Win32 Windows Microsoft Windows 7.0 Oct 25 2007 32 64}
IDL> mu='�' ; (the greek letter)
IDL> help,mu
MU STRING = '�'
IDL> help,byte(mu)
<Expression> BYTE = Array[2]
IDL> print,byte(mu)
194 181

The string entered in the workbench command line is encoded in UTF8.
Using this string as a title in direct graphics results in a mu
preceded by an "A" with a hat. Direct graphics don't like UTF8. It
would need string(181b) for a mu.

If I don't miss something, Reimar is asking for a function to convert
the UTF8 string to ISO8859(?).

Heinz
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: maximum LUN
Next Topic: Data organization question

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 02:22:18 PDT 2025

Total time taken to generate the page: 0.56141 seconds