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 dont 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 |
Dear Michael,
It seems the issue comes from the way the Script editor in Fiji (I haven't tried the vanilla Imagej version) is saving these characters. Indeed if I copy your macro in a Fiji Script editor window and then save the macro into the plugin folder I get some strange characters when I launch it then from the plugins window. But if I save your macro directly into the plugin folder it launches fine. Additionally if I open the 2 files within Notepad++ the file with the "working" macro is saved in Dos\Windows - ANSI and the other one in UNIX - ANSI as UTF-8. I hope this helps. My best regards, Philippe -----Message d'origine----- De : Cammer, Michael [mailto:[hidden email]] Envoyé : mercredi 2 juillet 2014 15:36 À : '[hidden email]' Cc : 'Rasband, Wayne (NIH/NIMH) [E]' Objet : RE: write é è à... in macros That's odd. Works fine here. =========================================================================== Michael Cammer, Microscopy Core & Dustin Lab , Skirball Institute, NYU Langone Medical Center Cell: 914-309-3270 Lab: 212-263-3208 http://ocs.med.nyu.edu/microscopy & http://www.med.nyu.edu/skirball-lab/dustinlab/ -----Original Message----- From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Philippe CARL Sent: Wednesday, July 02, 2014 8:23 AM To: [hidden email] Subject: write é è à... in macros 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 ------------------------------------------------------------ This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email. ================================= -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by CARL Philippe (LBP)
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 |
In reply to this post by CARL Philippe (LBP)
Hi Philippe,
On Wed, 2 Jul 2014, Philippe CARL wrote: > It seems the issue comes from the way the Script editor in Fiji (I haven't > tried the vanilla Imagej version) is saving these characters. For platform-independence, the script editor (which is actually now the ImageJ script editor, maintained as part of https://github.com/imagej/imagej-ui-swing) forces UTF-8 encoding and does not let Java on MacOSX use the Mac-only MacRoman encoding. I fear that ImageJ 1.x lets Java wreak havoc here; I would be *surprised* if the *very same* macro you saved with the script editor would fail to show the correct characters when being run on Linux or Windows. Ciao, Johannes -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Why not UTF-16?
-- Kenneth Sloan [hidden email] "La lutte elle-même vers les sommets suffit à remplir un coeur d'homme; il faut imaginer Sisyphe heureux." On Jul 2, 2014, at 10:29 , Johannes Schindelin <[hidden email]> wrote: > Hi Philippe, > > On Wed, 2 Jul 2014, Philippe CARL wrote: > >> It seems the issue comes from the way the Script editor in Fiji (I haven't >> tried the vanilla Imagej version) is saving these characters. > > For platform-independence, the script editor (which is actually now the > ImageJ script editor, maintained as part of > https://github.com/imagej/imagej-ui-swing) forces UTF-8 encoding and does > not let Java on MacOSX use the Mac-only MacRoman encoding. I fear that > ImageJ 1.x lets Java wreak havoc here; I would be *surprised* if the *very > same* macro you saved with the script editor would fail to show the > correct characters when being run on Linux or Windows. > > Ciao, > Johannes > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Dear Johannes,
I'm actually running Fiji (as well as the Script Editor) under Windows 7, not Mac... My best regards, Philippe -----Message d'origine----- De : ImageJ Interest Group [mailto:[hidden email]] De la part de Kenneth Sloan Envoyé : jeudi 3 juillet 2014 04:20 À : [hidden email] Objet : Re: write é è à... in macros Why not UTF-16? -- Kenneth Sloan [hidden email] "La lutte elle-même vers les sommets suffit à remplir un coeur d'homme; il faut imaginer Sisyphe heureux." On Jul 2, 2014, at 10:29 , Johannes Schindelin <[hidden email]> wrote: > Hi Philippe, > > On Wed, 2 Jul 2014, Philippe CARL wrote: > >> It seems the issue comes from the way the Script editor in Fiji (I >> haven't tried the vanilla Imagej version) is saving these characters. > > For platform-independence, the script editor (which is actually now > the ImageJ script editor, maintained as part of > https://github.com/imagej/imagej-ui-swing) forces UTF-8 encoding and > does not let Java on MacOSX use the Mac-only MacRoman encoding. I fear > that ImageJ 1.x lets Java wreak havoc here; I would be *surprised* if > the *very > same* macro you saved with the script editor would fail to show the > correct characters when being run on Linux or Windows. > > Ciao, > Johannes > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi Philippe,
On Thu, 3 Jul 2014, Philippe CARL wrote: > I'm actually running Fiji (as well as the Script Editor) under Windows 7, > not Mac... I guess that the ImageJ 1.x macro language uses the locale, then. This is in general a good idea for displaying values, but not for consuming code... Ciao, Johannes -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |