Search | | Contact Us | Resource Center Login | Home|

How do you display a euro symbol (€) to the user in a Synergy/DE application, assuming the terminal is opened on channel 1?

a. display(1, %char(164))
b. display(1, %char(^x(20))+%char(^x(ac)))
c. display(1, %char(^x(e2))+%char(^x(82))+%char(^x(ac)))
d. It depends on the character set in use
e. You can't, because the euro symbol is not a standard ASCII character

The character for the euro symbol is not a part of standard ASCII, but there are ways to get it to display in Synergy/DE.

The Unicode code-point for the euro symbol is 20AC, and that will work if the terminal you are using supports Unicode (for instance, the rxvt-unicode terminal window available for most Unix systems). However, the way you display the Unicode value 20AC depends on the Unicode encoding that the terminal expects. Answer (b) would work only if UTF-16 encoding is used. It's far more likely that UTF-8 is what you want, which answer (c) provides with the proper prefixes.

But what if Unicode isn't an option? For example, in a Synergy/DE Windows application or Windows console application, only ASCII characters are supported.

Extended ASCII maps bytes with the most significant bit on to various characters, depending on the character set in use. In the US, that's typically ISO-8859-1, which does not have a euro character.  However, ISO-8859-15 and ISO-8859-5 do contain the euro as decimal value 164. Therefore, answer (a) will work if and only if the current locale in Windows is set to use one of these character sets.

Thus, answer (d) is correct. Whether you're displaying to a console or a Windows application, the character set in use (ISO-8859 or Unicode) determines whether or not you can display a euro and how.