510-770-1417 | info@reachtech.com

by Reach Technology, a Novanta Company
Support > Frequently Asked Questions > How do I embed foreign language text in a macro?

How do I embed foreign language text in a macro?

 

The SLCD controller family uses UTF-8 encoding for non-ASCII characters. To incorporate UTF-8 characters into a macro file, you need to use an editor that supports UTF-8 encoding. Windows Notepad can do this. First, make sure you have a Unicode font installed (Arial Unicode MS comes with Microsoft Office) on your desktop so you can see the Unicode characters. Then start Notepad and set Format->Font to a Unicode font. Then select File->Save (or Save As…), and at the bottom of the pop-up box, you will see Encoding: ANSII. Click on the drop-down box and select UTF-8. Then save to set the encoding. Then, copy the following into the editor:

#define test 
m test2 "Нажмите здесь" 
#end
#define test2 
// display text argument somewhere 
t "`0`" 10 20 
#end

If you don’t see the Russian text, the font or encoding is wrong. Then, save the file as “testMacro”.txt or similar, download this macro file and a Unicode font (get font files) to the SLCD, select the font and run the macro. You should see the Russian for “Press here” (or “Click”) on the screen. See Fonts for Embedded Touch Screen Development for a comprehensive explanation of working with fonts.