Re: write é è à... in macros

Posted by Michael Schmid on
URL: http://imagej.273.s1.nabble.com/write-e-e-a-in-macros-tp5008532p5008540.html

Hi Philippe,

it looks like a matter of the default file encoding. I guess that Java takes that value from the operating system unless it is explicitly set via an option when staring the JVM. Probably it is set somewhere in the ImageJ launcher.

Use Plugins>Utilities>ImageJ Properties. This will tell you what you have (roughly 15 lines from top).

If you want to write macros not only for your personal use, I would strongly propose to write non-ascii characters in a way that is independent of file encoding.

Unfortunately, it seems that the ImageJ macro language currently does not support the java notation \u00e9, so currently you have to write, e.g.

  print("arriv"+fromCharCode(0x00e9));

Of course, you could write a short list defining the characters, e.g.
  eGrave=fromCharCode(0x00e8);
  eAcute=fromCharCode(0x00e9);
  print("arriv"+eAcute);

Michael
________________________________________________________________
On Jul 2, 2014, at 14:23, Philippe CARL wrote:

> Dear all,
>
> Being French (sorry about that), I would like to use sometimes characters
> like é è ê ë à ï (I guess this is it…) within macros.
>
> And as the use of such characters seem to be well implement within java or
> javascript languages
> (http://www.charbase.com/00e9-unicode-latin-small-letter-e-with-acute) I get
> quite strange behaviors in the macro language.
>
> Indeed given that I always program the macros within a Fiji Script… window,
> the characters get correctly show up if they are typed within a Script
> window and then the macro launched from there (= a Script window).
>
> But once the macro finalized, if I put then the macro inside the plugin
> folder and launch it via the plugins menu, the characters don’t come out
> correctly.
>
> Is there a way to fix this or a manual dealing about this (very sharp)
> question?
>
> Thanks a lot in advance for your help.
>
> My best regards,
>
> Philippe
>
>
>
> Philippe CARL
>
> Laboratoire de Biophotonique et Pharmacologie
>
> UMR 7213 CNRS - Université de Strasbourg
>
> Faculté de Pharmacie
>
> 74 route du Rhin
>
> 67401 ILLKIRCH
>
> Tel : +33(0)3 68 85 41 84
>
>
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html