Display non-ASCII character in ImageJ

A simple question, but I can not find the answer anywhere. So far, the search strategy has not worked for me.

I have an ImageJ macro that opens a dialog box for users to set the size of the image overlay. In the dialog box, the user is prompted to specify the size of the overlay in microns:

Dialog.addNumber("Widthm):", 500);
Dialog.addNumber("Heightm):", 250);

The problem is that the dialog is not displayed as expected: an additional symbol is displayed above the micron symbol. Instead (μm), I get this (¬μm).

This is a character encoding problem, of course. But I can't find any documentation anywhere, telling me how to correctly insert a non-ASCII character into the ImageJ dialog. I tried using ASCII code (230) and Unicode (U + 00B5) in every possible way, but in such cases it just displays as code, not as a character. ImageJ has macro calls to get a Unicode string for a character, but there is no way to print it except as a string of numbers? I'm at a dead end.

+3
source share
1 answer

What you do is:

Dialog.addNumber("Width (" + fromCharCode(181) + "m):", 500);
Dialog.addNumber("Height (" + fromCharCode(181) + "m):", 250);

where 181is the decimal value of hexidecimal00B5

0
source

All Articles