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

Home » Public Forums » archive » Special characters in PostScript
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
Special characters in PostScript [message #63714] Tue, 18 November 2008 06:55 Go to next message
Bernhard Reinhardt is currently offline  Bernhard Reinhardt
Messages: 26
Registered: October 2008
Junior Member
Hi,

is it possible to print special charakters like umlaut vowels in a
simple way to postscript files?

I´ve read Davids article "How can I place a less-than-or-equal sign (≤)
in my PostScript output?". But that is to complicated for routine use.

Is there something like setting a variable at startup to "ISO 8859-1".
The worst thing I´d accept would be a string converter-function. Like

title=convert_special_chars('Viele Umlaute: üöüöäßß')
plot, TITLE=title

Does something like that exist? If not, I rather resign on these characters.

Best regards

Bernhard
Re: Special characters in PostScript [message #63775 is a reply to message #63714] Thu, 20 November 2008 02:09 Go to previous messageGo to next message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Bernhard Reinhardt schrieb:
> David Fanning wrote:
>> Bernhard Reinhardt writes:
>>
>>> Solved the problem. The workbench saves the files in UTF-8. After
>>> setting the Text file encoding at Preferences->General-> Workspace to
>>> ISO-8859-1 everything is fine.
>>
>> Are we talking about *graphical* output, or something else?
>
> We are talking about a plot with a title.
> Is that graphical output? Who knows?

it is.

And currently you have no chance to change the encoding for the idl
command line. You can do this change only in the editor window.

On the command line you have to do something similiar to

IDL> plot,findgen(10),title='J'+string(252b)+'lich', chars=3

cheers
Reimar








>
> Regards
>
> bernhard
Re: Special characters in PostScript [message #63825 is a reply to message #63714] Thu, 20 November 2008 16:00 Go to previous messageGo to next message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
David Fanning schrieb:
> Reimar Bauer writes:
>
>> yes it is true. I am not sure if an email to the news server has an
>> unicode (utf-8) encoding already.
>>
>> plot,findgen(10),title='J�lich', chars=3
>>
>> but however the � char changes in different encoding
>>
>> and you have no chance to change the idl prompt. :(
>
> Maybe I am still misunderstanding something. I've
> typed this command with *several* different encoding
> changes in my Workbench and I see *absolutely* no
> difference in the graphical output. (Which is what
> I expected to see, actually.)
>

If you have old code it is different (wrong) encoded. If you type new
code it is encoded by utf-8 on default now. So you can't see the
problem. But all old code is broken.

The old text looks only right if you switch to iso encoding. Because you
have typed the � sign in iso encoding in the past it has only 1 byte for
it's definition.
It can't be correct shown in utf-8 expression. You do see a strange sign
in the editor. If you run the program you also plot that strange symbol.
If you switch the editor back to iso format you have the old 1 byte
expression of the � char which can be plotted correctly.

Usually you add in python a # -*- coding: iso-8859-1 -*- line if you
want your code iso encoded in an editor or # -*- coding: utf-8 -*-
if you want utf-8.

Our idl code does not follow this simple rule. The editor has no chance
to get in which encoding the text was done before.



cheers
Reimar

> Are you seeing something different? My output is
> "wrong", of course. A capital A with a tilde over
> it, followed by a 1/4 sign. But I can't see how
> changing the editor text encoding will help here.
>
> Cheers,
>
> David
Re: Special characters in PostScript [message #63846 is a reply to message #63714] Thu, 20 November 2008 09:24 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Reimar Bauer writes:

> yes it is true. I am not sure if an email to the news server has an
> unicode (utf-8) encoding already.
>
> plot,findgen(10),title='J�lich', chars=3
>
> but however the � char changes in different encoding
>
> and you have no chance to change the idl prompt. :(

Maybe I am still misunderstanding something. I've
typed this command with *several* different encoding
changes in my Workbench and I see *absolutely* no
difference in the graphical output. (Which is what
I expected to see, actually.)

Are you seeing something different? My output is
"wrong", of course. A capital A with a tilde over
it, followed by a 1/4 sign. But I can't see how
changing the editor text encoding will help here.

Cheers,

David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Special characters in PostScript [message #63857 is a reply to message #63714] Thu, 20 November 2008 07:14 Go to previous messageGo to next message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
David Fanning schrieb:
> Bernhard Reinhardt writes:
>
>> David Fanning wrote:
>>> Bernhard Reinhardt writes:
>>>
>>>> Solved the problem. The workbench saves the files in UTF-8. After
>>>> setting the Text file encoding at Preferences->General-> Workspace to
>>>> ISO-8859-1 everything is fine.
>>> Are we talking about *graphical* output, or something else?
>> We are talking about a plot with a title.
>> Is that graphical output? Who knows?
>
> So, let me get this straight. To get a character with an umlat,
> say, in the title of my IDL plot, I have to change the encoding
> of the Workbench *editor*? Even for IDL, that seems too weird.
> Are you sure about this? Can you give me an example?

Hi David

yes it is true. I am not sure if an email to the news server has an
unicode (utf-8) encoding already.

plot,findgen(10),title='J�lich', chars=3

but however the � char changes in different encoding

and you have no chance to change the idl prompt. :(

cheers
Reimar




>
> Cheers,
>
> David
>
Re: Special characters in PostScript [message #63910 is a reply to message #63714] Fri, 21 November 2008 03:36 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Bernhard Reinhardt writes:

> My Workbench saved the .pro-files in UTF8. I don�t know what idl does
> when I execute them. My guess is that the idl-interpreter expects
> ISO-Encoded files and thus is messing up with the UFT8-Files.
>
> After setting the default to ISO. The � was broken in the Workbench,
> too. After I corrected this and saved the file it worked.

I have a feeling this subject is going to be a bit like
coordinates and map projections. Every once in awhile, you
feel like you *almost* understand it, only to see your
understanding shaken by the next example. :-(

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: Special characters in PostScript [message #63912 is a reply to message #63846] Fri, 21 November 2008 03:27 Go to previous message
Bernhard Reinhardt is currently offline  Bernhard Reinhardt
Messages: 26
Registered: October 2008
Junior Member
David Fanning wrote:
> Reimar Bauer writes:
>
>> yes it is true. I am not sure if an email to the news server has an
>> unicode (utf-8) encoding already.
>>
>> plot,findgen(10),title='J�lich', chars=3
>>
>> but however the � char changes in different encoding
>>
>> and you have no chance to change the idl prompt. :(
>
> Maybe I am still misunderstanding something. I've
> typed this command with *several* different encoding
> changes in my Workbench and I see *absolutely* no
> difference in the graphical output. (Which is what
> I expected to see, actually.)
>
> Are you seeing something different? My output is
> "wrong", of course. A capital A with a tilde over
> it, followed by a 1/4 sign. But I can't see how
> changing the editor text encoding will help here.

My Workbench saved the .pro-files in UTF8. I don�t know what idl does
when I execute them. My guess is that the idl-interpreter expects
ISO-Encoded files and thus is messing up with the UFT8-Files.

After setting the default to ISO. The � was broken in the Workbench,
too. After I corrected this and saved the file it worked.

Regards

Bernhard
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL 32/64 bits
Next Topic: Re: AVIs for the Mac

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

Current Time: Wed Oct 08 15:57:55 PDT 2025

Total time taken to generate the page: 0.00664 seconds