Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #13786 > unrolled thread

Re: Greek symbols mangled by InputForm

Started byJohn Fultz <jfultz@wolfram.com>
First post2013-03-08 21:46 +0000
Last post2013-03-14 11:12 +0000
Articles 6 — 3 participants

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Greek symbols mangled by InputForm John Fultz <jfultz@wolfram.com> - 2013-03-08 21:46 +0000
    Re: Greek symbols mangled by InputForm carlos%colorado.edu@gtempaccount.com - 2013-03-10 05:47 +0000
    Re: Greek symbols mangled by InputForm John Fultz <jfultz@wolfram.com> - 2013-03-11 08:42 +0000
    Re: Greek symbols mangled by InputForm carlos%colorado.edu@gtempaccount.com - 2013-03-12 04:34 +0000
      Re: Greek symbols mangled by InputForm David Bailey <dave@removedbailey.co.uk> - 2013-03-13 08:18 +0000
    Re: Greek symbols mangled by InputForm carlos%colorado.edu@gtempaccount.com - 2013-03-14 11:12 +0000

#13786 — Re: Greek symbols mangled by InputForm

FromJohn Fultz <jfultz@wolfram.com>
Date2013-03-08 21:46 +0000
SubjectRe: Greek symbols mangled by InputForm
Message-ID<khdm7h$f0k$1@smc.vnet.net>
That has nothing to do with the notebook being very old.  That's just a 
stupid bug in how InputForm communications between kernel and FE happen. 
 We already had an open bug report about this, and I just pinged the bug 
again with a reference to your post.  Here's a way you could work around 
the bug:

Block[{$CharacterEncoding = "Unicode"}, Print[\[Mu]//InputForm]]

John Fultz
jfultz@wolfram.com
User Interface Group
Wolfram Research, Inc.



On Mar 7, 2013, at 9:49 PM, carlos%colorado.edu@gtempaccount.com wrote:

> I opened a very old notebook (done in Mathematica 4 some 10 years ago) 
under Mathematica 9.0.1 running under Mac OS X 10.6.9.   The InputForm 
output of Greek symbols is mangled. For example
>
>    Print[\[Mu]//InputForm]
>
> produces a circumflexed I followed by the 1/4 fraction. Cutting and 
pasting that output into an Input cell  reproduces that garbage.  The 
problem seems to occur only with that filter, which unfortunately I use 
a lot for inlining code.
>
> Is there an option that can be set so that the Greek symbols are 
respected?
> Thanks.
>

[toc] | [next] | [standalone]


#13801

Fromcarlos%colorado.edu@gtempaccount.com
Date2013-03-10 05:47 +0000
Message-ID<khh6ph$al2$1@smc.vnet.net>
In reply to#13786
On Friday, March 8, 2013 2:46:25 PM UTC-7, John Fultz wrote:
> That has nothing to do with the notebook being very old.  That's just a 
> 
> stupid bug in how InputForm communications between kernel and FE happen. 
> 
>  We already had an open bug report about this, and I just pinged the bug 
> 
> again with a reference to your post.  Here's a way you could work around 
> 
> the bug:
> 
> 
> 
> Block[{$CharacterEncoding = "Unicode"}, Print[\[Mu]//InputForm]]

Would it be sufficient to put

$CharacterEncoding="Unicode";

at the start of the NB?

[toc] | [prev] | [next] | [standalone]


#13810

FromJohn Fultz <jfultz@wolfram.com>
Date2013-03-11 08:42 +0000
Message-ID<khk5dv$8mb$1@smc.vnet.net>
In reply to#13786
On Mar 9, 2013, at 11:48 PM, carlos%colorado.edu@gtempaccount.com wrote:

> On Friday, March 8, 2013 2:46:25 PM UTC-7, John Fultz wrote:
>> That has nothing to do with the notebook being very old.  That's just a
>>
>> stupid bug in how InputForm communications between kernel and FE happen.
>>
>> We already had an open bug report about this, and I just pinged the bug
>>
>> again with a reference to your post.  Here's a way you could work around
>>
>> the bug:
>>
>>
>>
>> Block[{$CharacterEncoding = "Unicode"}, Print[\[Mu]//InputForm]]
>
> Would it be sufficient to put
>
> $CharacterEncoding="Unicode";
>
> at the start of the NB?

My use of Block was being cautious.  Having done a little investigation, perhaps it's overly cautious, as changing $CharacterEncoding probably won't have any ill effects on other operations in the kernel.

But it's possible I could be overlooking something.

John Fultz
jfultz@wolfram.com
User Interface Group
Wolfram Research, Inc.

[toc] | [prev] | [next] | [standalone]


#13816

Fromcarlos%colorado.edu@gtempaccount.com
Date2013-03-12 04:34 +0000
Message-ID<khmb7v$ngo$1@smc.vnet.net>
In reply to#13786
> 
> 
> My use of Block was being cautious.  Having done a little investigation, perhaps it's overly cautious, as changing $CharacterEncoding probably won't have any ill effects on other operations in the kernel.
> 
> 
> 
> But it's possible I could be overlooking something.
> 
> 
> 
> John Fultz
> 
> jfultz@wolfram.com
> 
> User Interface Group
> 
> Wolfram Research, Inc.

I tried it on a large code of about 15000 commands (a finite element analysis program used in graduate courses) with 9.0.1 and saw no (obvious) ill effects under Mac OS 10.6.  It was set in an initialization cell at start.

Question: some of my students might have to run this program under Windows or Linux.  Is there a way to access a OS tag from within Mathematica, so that 

$CharacterEncoding="Unicode";

is set only under Mac OS X?  (I am not sure if Windows or Linux needs that)

[toc] | [prev] | [next] | [standalone]


#13821

FromDavid Bailey <dave@removedbailey.co.uk>
Date2013-03-13 08:18 +0000
Message-ID<khpcp7$me8$1@smc.vnet.net>
In reply to#13816
On 12/03/2013 04:34, carlos%colorado.edu@gtempaccount.com wrote:
>>
>>
>> My use of Block was being cautious.  Having done a little investigation, perhaps it's overly cautious, as changing $CharacterEncoding probably won't have any ill effects on other operations in the kernel.
>>
>>
>>
>> But it's possible I could be overlooking something.
>>
>>
>>
>> John Fultz
>>
>> jfultz@wolfram.com
>>
>> User Interface Group
>>
>> Wolfram Research, Inc.
>
> I tried it on a large code of about 15000 commands (a finite element analysis program used in graduate courses) with 9.0.1 and saw no (obvious) ill effects under Mac OS 10.6.  It was set in an initialization cell at start.
>
> Question: some of my students might have to run this program under Windows or Linux.  Is there a way to access a OS tag from within Mathematica, so that
>
> $CharacterEncoding="Unicode";
>
> is set only under Mac OS X?  (I am not sure if Windows or Linux needs that)
>
>

You can test the string obtained from $OperatingSystem

In[4]:= $OperatingSystem

Out[4]= "Windows"

or

In[6]:= $System

Out[6]= "Microsoft Windows (64-bit)"

BTW, it is worth exploring all the $ variables - they contain all sorts 
of information:

?$*

David Bailey
http://www.dbaileyconsultancy.co.uk

[toc] | [prev] | [next] | [standalone]


#13834

Fromcarlos%colorado.edu@gtempaccount.com
Date2013-03-14 11:12 +0000
Message-ID<khsbak$35j$1@smc.vnet.net>
In reply to#13786
On Wednesday, March 13, 2013 2:18:47 AM UTC-6, David Bailey wrote:
> On 12/03/2013 04:34, carlos%colorado.edu@gtempaccount.com wrote:
> 
> >>
> 
> >>
> 
> >> My use of Block was being cautious.  Having done a little investigation, perhaps it's overly cautious, as changing $CharacterEncoding probably won't have any ill effects on other operations in the kernel.
> 
> >>
> 
> >>
> 
> >>
> 
> >> But it's possible I could be overlooking something.
> 
> >>
> 
> >>
> 
> >>
> 
> >> John Fultz
> 
> >>
> 
> >> jfultz@wolfram.com
> 
> >>
> 
> >> User Interface Group
> 
> >>
> 
> >> Wolfram Research, Inc.
> 
> >
> 
> > I tried it on a large code of about 15000 commands (a finite element analysis program used in graduate courses) with 9.0.1 and saw no (obvious) ill effects under Mac OS 10.6.  It was set in an initialization cell at start.
> 
> >
> 
> > Question: some of my students might have to run this program under Windows or Linux.  Is there a way to access a OS tag from within Mathematica, so that
> 
> >
> 
> > $CharacterEncoding="Unicode";
> 
> >
> 
> > is set only under Mac OS X?  (I am not sure if Windows or Linux needs that)
> 
> >
> 
> >
> 
> 
> 
> You can test the string obtained from $OperatingSystem
> 
> 
> 
> In[4]:= $OperatingSystem
> 
> 
> 
> Out[4]= "Windows"
> 
> 
> 
> or
> 
> 
> 
> In[6]:= $System
> 
> 
> 
> Out[6]= "Microsoft Windows (64-bit)"
> 
> 
> 
> BTW, it is worth exploring all the $ variables - they contain all sorts 
> 
> of information:
> 
> 
> 
> ?$*
> 
> 
> 
> David Bailey
> 
> http://www.dbaileyconsultancy.co.uk

Many thanks for all the help.  Here is my new version-dependent initialization
cell, initialized at the top of the NB:

DisplayChannel=$DisplayFunction;
Joinedlistplot=PlotJoined->True;
If [$VersionNumber>=6.0, DisplayChannel=Print];  
If [$VersionNumber>=9.0&&$OperatingSystem=="MacOSX", 
    $CharacterEncoding="Unicode"];
If [$VersionNumber>=9.0, Joinedlistplot=Joined->True];

Not sure what happens to greeksymbol//InputForm under other OS, but
students do not need that filter.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web