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

Home » Public Forums » archive » Re: localising IDL programs
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: localising IDL programs [message #73928] Thu, 09 December 2010 18:23 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
nata writes:

> Are you sure ? I still have problems with that link

Sheesh! I just finished a big image processing chapter
today. Still recovering, I guess. Too many celebratory
beers. :-)

Try this:

http://www.dfanning.com/template_books.html

> Could you send me a png or ps when you are going to
> publish your book ?

I'll do better than that. I'll send you a book. ;-)

Cheers,

David

P.S. 320 pages so far, and still three weeks to go
before I promised myself a first draft. There is a
chance I might make it if I don't have to do any
Christmas shopping! :-)


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: localising IDL programs [message #73929 is a reply to message #73928] Thu, 09 December 2010 17:51 Go to previous messageGo to next message
natha is currently offline  natha
Messages: 482
Registered: October 2007
Senior Member
On 9 dic, 20:39, David Fanning <n...@dfanning.com> wrote:
> nata writes:
>> Yes ! I can write the article but the link you just gave me is
>> invalid.
>
> Whoops! OK, it is there now. Thanks! :-)

Are you sure ? I still have problems with that link

>> I'm also waiting response to know if you finally included my radar
>> images in your new book.
>
> Yes, I can't reveal details, but I think some your images
> are on the front cover. :-)

Could you send me a png or ps when you are going to publish your
book ?
Re: localising IDL programs [message #73930 is a reply to message #73929] Thu, 09 December 2010 17:39 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
nata writes:

> Yes ! I can write the article but the link you just gave me is
> invalid.

Whoops! OK, it is there now. Thanks! :-)

> I'm also waiting response to know if you finally included my radar
> images in your new book.

Yes, I can't reveal details, but I think some your images
are on the front cover. :-)

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: localising IDL programs [message #73931 is a reply to message #73930] Thu, 09 December 2010 17:33 Go to previous messageGo to next message
natha is currently offline  natha
Messages: 482
Registered: October 2007
Senior Member
Thank you David,
Yes ! I can write the article but the link you just gave me is
invalid.
I'm also waiting response to know if you finally included my radar
images in your new book.

Cheers,
nata
Re: localising IDL programs [message #73932 is a reply to message #73931] Thu, 09 December 2010 17:26 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
nata writes:

> If you are interested I changed the routine to something more elegant:
>
> str='hola què tal com estàs ?'
> res=DIALOG_MESSAGE(ANSI_VALUE(str))
>
> It works ! :)

Hi Nata,

Do you want to become famous by writing an article
for my web page about this? :-)

If so, you can find a template here:

http://www.dfannnig.com/template_books.html

I'm happy to host this program for you.

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: localising IDL programs [message #73933 is a reply to message #73932] Thu, 09 December 2010 16:05 Go to previous messageGo to next message
natha is currently offline  natha
Messages: 482
Registered: October 2007
Senior Member
If you are interested I changed the routine to something more elegant:

str='hola què tal com estàs ?'
res=DIALOG_MESSAGE(ANSI_VALUE(str))

It works ! :)

The trick is do that:

FUNCTION ANSI_VALUE, str_in

str_inb=BYTE(str_in)
str_nel=N_ELEMENTS(str_inb)

FOR i=0l, str_nel-1 DO BEGIN

IF str_inb[i] GT 126b THEN BEGIN
char_in=STRING(str_inb[i:(i+1)<(str_nel-1)])
i++
ENDIF ELSE char_in=STRING(str_inb[i])

CASE char_in OF

'€': ...
.....

nata
Re: localising IDL programs [message #73934 is a reply to message #73933] Thu, 09 December 2010 14:08 Go to previous messageGo to next message
natha is currently offline  natha
Messages: 482
Registered: October 2007
Senior Member
Just in case, I created the following routine. It seems to work on my
machine

res=DIALOG_MESSAGE(ANSI_VALUE('hola qu'+ANSI_VALUE('è')+' tal com
est'+ANSI_VALUE('à')+'s ?'))

Cheers,
nata


FUNCTION ANSI_VALUE, char_in

CASE char_in OF

'€': ansi_char=STRING(128B)
'‚': ansi_char=STRING(130B)
'ƒ': ansi_char=STRING(131B)
'„': ansi_char=STRING(132B)
'…': ansi_char=STRING(133B)
'†': ansi_char=STRING(134B)
'‡': ansi_char=STRING(135B)
'ˆ': ansi_char=STRING(136B)
'‰': ansi_char=STRING(137B)
'Š': ansi_char=STRING(138B)
'‹': ansi_char=STRING(139B)
'Œ': ansi_char=STRING(140B)
'Ž': ansi_char=STRING(142B)
'‘': ansi_char=STRING(145B)
'’': ansi_char=STRING(146B)
'“': ansi_char=STRING(147B)
'”': ansi_char=STRING(148B)
'•': ansi_char=STRING(149B)
'–': ansi_char=STRING(150B)
'—': ansi_char=STRING(151B)
'˜': ansi_char=STRING(152B)
'™': ansi_char=STRING(153B)
'š': ansi_char=STRING(154B)
'›': ansi_char=STRING(155B)
'œ': ansi_char=STRING(156B)
'ž': ansi_char=STRING(158B)
'Ÿ': ansi_char=STRING(159B)
'¡': ansi_char=STRING(161B)
'¢': ansi_char=STRING(162B)
'£': ansi_char=STRING(163B)
'¤': ansi_char=STRING(164B)
'¥': ansi_char=STRING(165B)
'¦': ansi_char=STRING(166B)
'§': ansi_char=STRING(167B)
'¨': ansi_char=STRING(168B)
'©': ansi_char=STRING(169B)
'ª': ansi_char=STRING(170B)
'«': ansi_char=STRING(171B)
'¬': ansi_char=STRING(172B)
'®': ansi_char=STRING(174B)
'¯': ansi_char=STRING(175B)
'°': ansi_char=STRING(176B)
'±': ansi_char=STRING(177B)
'²': ansi_char=STRING(178B)
'³': ansi_char=STRING(179B)
'´': ansi_char=STRING(180B)
'µ': ansi_char=STRING(181B)
'¶': ansi_char=STRING(182B)
'·': ansi_char=STRING(183B)
'¸': ansi_char=STRING(184B)
'¹': ansi_char=STRING(185B)
'º': ansi_char=STRING(186B)
'»': ansi_char=STRING(187B)
'¼': ansi_char=STRING(188B)
'½': ansi_char=STRING(189B)
'¾': ansi_char=STRING(190B)
'¿': ansi_char=STRING(191B)
'À': ansi_char=STRING(192B)
'Á': ansi_char=STRING(193B)
'Â': ansi_char=STRING(194B)
'Ã': ansi_char=STRING(195B)
'Ä': ansi_char=STRING(196B)
'Å': ansi_char=STRING(197B)
'Æ': ansi_char=STRING(198B)
'Ç': ansi_char=STRING(199B)
'È': ansi_char=STRING(200B)
'É': ansi_char=STRING(201B)
'Ê': ansi_char=STRING(202B)
'Ë': ansi_char=STRING(203B)
'Ì': ansi_char=STRING(204B)
'Í': ansi_char=STRING(205B)
'Î': ansi_char=STRING(206B)
'Ï': ansi_char=STRING(207B)
'Ð': ansi_char=STRING(208B)
'Ñ': ansi_char=STRING(209B)
'Ò': ansi_char=STRING(210B)
'Ó': ansi_char=STRING(211B)
'Ô': ansi_char=STRING(212B)
'Õ': ansi_char=STRING(213B)
'Ö': ansi_char=STRING(214B)
'×': ansi_char=STRING(215B)
'Ø': ansi_char=STRING(216B)
'Ù': ansi_char=STRING(217B)
'Ú': ansi_char=STRING(218B)
'Û': ansi_char=STRING(219B)
'Ü': ansi_char=STRING(220B)
'Ý': ansi_char=STRING(221B)
'Þ': ansi_char=STRING(222B)
'ß': ansi_char=STRING(223B)
'à': ansi_char=STRING(224B)
'á': ansi_char=STRING(225B)
'â': ansi_char=STRING(226B)
'ã': ansi_char=STRING(227B)
'ä': ansi_char=STRING(228B)
'å': ansi_char=STRING(229B)
'æ': ansi_char=STRING(230B)
'ç': ansi_char=STRING(231B)
'è': ansi_char=STRING(232B)
'é': ansi_char=STRING(233B)
'ê': ansi_char=STRING(234B)
'ë': ansi_char=STRING(235B)
'ì': ansi_char=STRING(236B)
'í': ansi_char=STRING(237B)
'î': ansi_char=STRING(238B)
'ï': ansi_char=STRING(239B)
'ð': ansi_char=STRING(240B)
'ñ': ansi_char=STRING(241B)
'ò': ansi_char=STRING(242B)
'ó': ansi_char=STRING(243B)
'ô': ansi_char=STRING(244B)
'õ': ansi_char=STRING(245B)
'ö': ansi_char=STRING(246B)
'÷': ansi_char=STRING(247B)
'ø': ansi_char=STRING(248B)
'ù': ansi_char=STRING(249B)
'ú': ansi_char=STRING(250B)
'û': ansi_char=STRING(251B)
'ü': ansi_char=STRING(252B)
'ý': ansi_char=STRING(253B)
'þ': ansi_char=STRING(254B)
'ÿ': ansi_char=STRING(255B)

ELSE: ansi_char=char_in

END

RETURN, ansi_char
END
Re: localising IDL programs [message #73935 is a reply to message #73934] Thu, 09 December 2010 13:44 Go to previous messageGo to next message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Dec 9, 7:23 pm, nata <bernat.puigdomen...@gmail.com> wrote:
> Ok,
> It seems that you have to use the ASCII values. You can consult the
> following web site to get the decimal values :http://ascii-table.com/special-chars.php
>
> So if you want to display: 'hola què tal com estàs ?'
> You should do:
>
> res=DIALOG_MESSAGE('hola qu'+STRING(232b)+' tal com est'+STRING(224b)
> +'s ?')

Though those (anything beyond 127) are not ASCII. That is an extension
from ASCII to 8-bit, and the characters can vary with the encoding
used.

The central problem is IDL's lack of Unicode support. Which languages
created recently (like Java) have builtin, at the source code level,
and other old languages support in varying levels of awkward retrofit.
Re: localising IDL programs [message #73936 is a reply to message #73935] Thu, 09 December 2010 13:23 Go to previous messageGo to next message
natha is currently offline  natha
Messages: 482
Registered: October 2007
Senior Member
Ok,
It seems that you have to use the ASCII values. You can consult the
following web site to get the decimal values :
http://ascii-table.com/special-chars.php

So if you want to display: 'hola què tal com estàs ?'
You should do:

res=DIALOG_MESSAGE('hola qu'+STRING(232b)+' tal com est'+STRING(224b)
+'s ?')

Cheers,
nata
Re: localising IDL programs [message #73937 is a reply to message #73936] Thu, 09 December 2010 13:14 Go to previous messageGo to next message
natha is currently offline  natha
Messages: 482
Registered: October 2007
Senior Member
That's a very good question. I also have the same problem (using
Windows) and I never found the way to do it.
Waiting for the answer...

nata
Re: localising IDL programs [message #74006 is a reply to message #73928] Sun, 12 December 2010 18:54 Go to previous messageGo to next message
wallabadah is currently offline  wallabadah
Messages: 28
Registered: November 2005
Junior Member
On Dec 10, 1:23 pm, David Fanning <n...@dfanning.com> wrote:
> nata writes:
>> Are you sure ? I still have problems with that link
>
> Sheesh! I just finished a big image processing chapter
> today. Still recovering, I guess. Too many celebratory
> beers. :-)
>
> Try this:
>
>   http://www.dfanning.com/template_books.html
>
>> Could you send me a png or ps when you are going to
>> publish your book ?
>
> I'll do better than that. I'll send you a book. ;-)
>
> Cheers,
>
> David
>
> P.S. 320 pages so far, and still three weeks to go
> before I promised myself a first draft. There is a
> chance I might make it if I don't have to do any
> Christmas shopping! :-)
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

Thanks for the great responses, using the lookup table approach
appears to have solved the problem.

cheers,

Will.
Re: localising IDL programs [message #85184 is a reply to message #74006] Thu, 11 July 2013 10:47 Go to previous messageGo to next message
Andy Sayer is currently offline  Andy Sayer
Messages: 127
Registered: February 2009
Senior Member
Hi all,

Apologies for bumping an old thread, but I have a similar issue. The lookup table given in previous posts works great for screen output. But, I am having odd behaviour when I try to write to eps output. Specifically, rather than á, 225B gives me Æ (which should be 198B). 198B gives a breve accent. So it doesn't appear to be a swapping of just those two characters, but a different mapping.

Is there some alternate mapping/wizardry I need to do to make it work on eps output? I like to use device,/times and have tested e.g. courier but it gives the same behaviour.

This is using IDL 7.1.1 on a CentOS machine, in case it makes a difference. Any suggestions would be appreciated! I did a Google search and search on this group, but this thread was closest I found to the answer.

Thanks,

Andy


On Sunday, December 12, 2010 9:54:13 PM UTC-5, wallabadah wrote:
> On Dec 10, 1:23 pm, David Fanning <n...@dfanning.com> wrote:
>> nata writes:
>>> Are you sure ? I still have problems with that link
>>
>> Sheesh! I just finished a big image processing chapter
>> today. Still recovering, I guess. Too many celebratory
>> beers. :-)
>>
>> Try this:
>>
>>   http://www.dfanning.com/template_books.html
>>
>>> Could you send me a png or ps when you are going to
>>> publish your book ?
>>
>> I'll do better than that. I'll send you a book. ;-)
>>
>> Cheers,
>>
>> David
>>
>> P.S. 320 pages so far, and still three weeks to go
>> before I promised myself a first draft. There is a
>> chance I might make it if I don't have to do any
>> Christmas shopping! :-)
>>
>> --
>> David Fanning, Ph.D.
>> Fanning Software Consulting, Inc.
>> Coyote's Guide to IDL Programming:http://www.dfanning.com/
>> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>
> Thanks for the great responses, using the lookup table approach
> appears to have solved the problem.
>
> cheers,
>
> Will.
Re: localising IDL programs [message #85200 is a reply to message #85184] Fri, 12 July 2013 09:03 Go to previous messageGo to next message
Andy Sayer is currently offline  Andy Sayer
Messages: 127
Registered: February 2009
Senior Member
Ok, I fiddled around some more this morning but still can't get it working.

I also tried using string("341B) which should be the octal representation for á in that font according to IDL documentation, but again get Æ. I have experimented but can't find any simple map between the symbol that ASCII tables tell me I should get for a given value, and the symbol I actually get when writing to postscript.

Any thoughts?

Andy

On Thursday, July 11, 2013 1:47:33 PM UTC-4, AMS wrote:
> Hi all,
>
>
>
> Apologies for bumping an old thread, but I have a similar issue. The lookup table given in previous posts works great for screen output. But, I am having odd behaviour when I try to write to eps output. Specifically, rather than á, 225B gives me Æ (which should be 198B). 198B gives a breve accent. So it doesn't appear to be a swapping of just those two characters, but a different mapping.
>
>
>
> Is there some alternate mapping/wizardry I need to do to make it work on eps output? I like to use device,/times and have tested e.g. courier but it gives the same behaviour.
>
>
>
> This is using IDL 7.1.1 on a CentOS machine, in case it makes a difference. Any suggestions would be appreciated! I did a Google search and search on this group, but this thread was closest I found to the answer.
>
>
>
> Thanks,
>
>
>
> Andy
>
>
>
>
>
> On Sunday, December 12, 2010 9:54:13 PM UTC-5, wallabadah wrote:
>
>> On Dec 10, 1:23 pm, David Fanning <n...@dfanning.com> wrote:
>
>>> nata writes:
>
>>>> Are you sure ? I still have problems with that link
>
>>>
>
>>> Sheesh! I just finished a big image processing chapter
>
>>> today. Still recovering, I guess. Too many celebratory
>
>>> beers. :-)
>
>>>
>
>>> Try this:
>
>>>
>
>>>   http://www.dfanning.com/template_books.html
>
>>>
>
>>>> Could you send me a png or ps when you are going to
>
>>>> publish your book ?
>
>>>
>
>>> I'll do better than that. I'll send you a book. ;-)
>
>>>
>
>>> Cheers,
>
>>>
>
>>> David
>
>>>
>
>>> P.S. 320 pages so far, and still three weeks to go
>
>>> before I promised myself a first draft. There is a
>
>>> chance I might make it if I don't have to do any
>
>>> Christmas shopping! :-)
>
>>>
>
>>> --
>
>>> David Fanning, Ph.D.
>
>>> Fanning Software Consulting, Inc.
>
>>> Coyote's Guide to IDL Programming:http://www.dfanning.com/
>
>>> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>
>>
>
>> Thanks for the great responses, using the lookup table approach
>
>> appears to have solved the problem.
>
>>
>
>> cheers,
>
>>
>
>> Will.
Re: localising IDL programs [message #85201 is a reply to message #85200] Fri, 12 July 2013 09:08 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
AMS writes:

> Ok, I fiddled around some more this morning but still can't get it working.
>
> I also tried using string("341B) which should be the octal representation for á in that font according to IDL documentation, but again get Æ. I have experimented but can't find any simple map between the symbol that ASCII tables tell me I should get for a given value, and the symbol I actually get when writing to postscript.
>
> Any thoughts?

My only thought is that these values are almost *always* different in
PostScript. See, for example, the contortions I have to go through to
produce similar output on the display and in PostScript files in
cgSymbol:

http://www.idlcoyote.com/programs/cgsymbol.pro

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: localising IDL programs [message #85204 is a reply to message #85201] Fri, 12 July 2013 10:29 Go to previous messageGo to next message
Andy Sayer is currently offline  Andy Sayer
Messages: 127
Registered: February 2009
Senior Member
Aha! The plot thickens. Your suggestion inspired me to open up the output postscript file in a text editor, and I found the place where the relevant bit of text is contained. IDL is writing code \341 there, which from before is the correct octal value for á. So that bit was right. I also found this page which shows that \341 is Æ in text encoding, but á in ISO Latin-1 encoding: http://www.math.u-bordeaux1.fr/~mleguebe/docs/gnuplot_liite3 4.pdf

So, I checked the IDL help and there is a keyword /isolatin1 to device. I set that, and it displays as intended.

Thanks,

Andy

On Friday, July 12, 2013 12:08:23 PM UTC-4, David Fanning wrote:
> AMS writes:
>
>
>
>> Ok, I fiddled around some more this morning but still can't get it working.
>
>>
>
>> I also tried using string("341B) which should be the octal representation for á in that font according to IDL documentation, but again get Æ. I have experimented but can't find any simple map between the symbol that ASCII tables tell me I should get for a given value, and the symbol I actually get when writing to postscript.
>
>>
>
>> Any thoughts?
>
>
>
> My only thought is that these values are almost *always* different in
>
> PostScript. See, for example, the contortions I have to go through to
>
> produce similar output on the display and in PostScript files in
>
> cgSymbol:
>
>
>
> http://www.idlcoyote.com/programs/cgsymbol.pro
>
>
>
> Cheers,
>
>
>
> David
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: localising IDL programs [message #85205 is a reply to message #85204] Fri, 12 July 2013 10:36 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
AMS writes:

> Aha! The plot thickens. Your suggestion inspired me to open up the output postscript file in a text editor, and I found the place where the relevant bit of text is contained. IDL is writing code \341 there, which from before is the correct octal value for á. So that bit was right. I also found this page which shows that \341 is Æ in text encoding, but á in ISO Latin-1 encoding: http://www.math.u-bordeaux1.fr/~mleguebe/docs/gnuplot_liite3 4.pdf
>
> So, I checked the IDL help and there is a keyword /isolatin1 to device. I set that, and it displays as intended.

There you go, mystery solved.

Now you see why every time someone so much as touches a Coyote Graphics
command the PostScript device gets configured with COLOR=1,
BITS_PER_PIXEL=8, and /ISOLATIN1. Saves a LOT of problems later on. :-)

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: localising IDL programs [message #85207 is a reply to message #85205] Fri, 12 July 2013 11:29 Go to previous message
Andy Sayer is currently offline  Andy Sayer
Messages: 127
Registered: February 2009
Senior Member
Heh. Yeah, I had not known of/had to use /isolatin1 before.

On Friday, July 12, 2013 1:36:22 PM UTC-4, David Fanning wrote:
> AMS writes:
>
>
>
>> Aha! The plot thickens. Your suggestion inspired me to open up the output postscript file in a text editor, and I found the place where the relevant bit of text is contained. IDL is writing code \341 there, which from before is the correct octal value for á. So that bit was right. I also found this page which shows that \341 is Æ in text encoding, but á in ISO Latin-1 encoding: http://www.math.u-bordeaux1.fr/~mleguebe/docs/gnuplot_liite3 4.pdf
>
>>
>
>> So, I checked the IDL help and there is a keyword /isolatin1 to device. I set that, and it displays as intended.
>
>
>
> There you go, mystery solved.
>
>
>
> Now you see why every time someone so much as touches a Coyote Graphics
>
> command the PostScript device gets configured with COLOR=1,
>
> BITS_PER_PIXEL=8, and /ISOLATIN1. Saves a LOT of problems later on. :-)
>
>
>
> Cheers,
>
>
>
> David
>
>
>
>
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Font List
Next Topic: How come? Weird subarray problem...

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

Current Time: Wed Oct 08 13:43:48 PDT 2025

Total time taken to generate the page: 0.00533 seconds