Find where character encoding changes
When a character looks right on screen but wrong in a file or PDF, follow one value through the whole job. The client, stored data, export and PDF renderer can use different encodings.
- Try a known value, such as a name with an accent. Check the saved record, the exported bytes and the final display separately.
- For PDF output, check APPX_PDF_ENCODING in the engine environment and confirm that the selected font contains the character. The renderer defaults vary by release.
- For an import, identify the actual file encoding before changing a client or engine setting. Changing the setting does not convert records already on disk.
Character encoding wasn't much of an issue in the pre-internet and pre-PDF days. This is because the first 128 characters in most encoding schemas are the same, and there wasn't much need for characters beyond that threshold. Today, that scenario has changed. With the introduction of the Euro symbol and exporting XML data out of Appx, it requires you to consider the encoding used amongst the various components of your Appx environment.
The following sections describe how encoding is handled at each stage, including differences between releases.
Encoding today is relevant in several distinct areas:
Entering a Euro symbol on a windows java desktop connected to a Linux server running Appx 5.4.2. From the AppxDesktopClient, Windows-1252 (default) encoding, you enter a Euro symbol, EUR (alt+0128) into a field and save the record. The associated number value of the Euro symbol for the 1252 schema is 128, see Windows-1252 table. The Appx engine, set to use ISO-8859-15 (default), stores the character value 128. Note that a 128 in the ISO-8859-15 table is not a Euro symbol. Even so, the Euro symbol is displayed in your Appx Application field. That's because your desktop is using the 1252 character set. If you looked at this same record on another desktop using a different character encoding schema, the character would be displayed using whatever symbol was associated with a value of 128 (probably not the Euro symbol).
To correct this you would simply set the second client to windows-1252 and start a new session. It's important to understand that the data on the server is not converted, but rather, the raw character value associated with the client encoding schema is maintained.
Taking this example one step further, let's say your Appx application was importing data directly into your application. If the character encoding of that data is different from that of your Appx client you might not see a true representation of that data when using the client. Keep in mind that the raw character encoding value is saved in your Appx file.
Recommendation: All AppxDesktopClients that connect to your Appx engine should be using the same character encoding. HTML Client The HTML client displays all data in UTF-8 encoding. The engine transcodes from it's default encoding of ISO-8859-15 to UTF-8 when sending data to the client, and from UTF-8 to ISO-8859-15 when receiving data from the client. If APPX_RAW_ENCODING is specified, it uses that instead of ISO-8859-15. Appx Engine In all Appx releases prior to 6.0 the Appx engine is a single byte processor and, by default, is set to use the ISO-8859-15 character set. Multi-byte characters from another source will be saved in Appx as raw data byte by byte. The programmer must accommodate for the potential character identification.
Appx desktop client (Java)
The Appx clients' default character set is Windows-1252. The Appx engine on the other hand uses ISO-8859-15. You might think that the client default would be a problem; however that is not the case. The following example will illustrate why:Entering a Euro symbol on a windows java desktop connected to a Linux server running Appx 5.4.2. From the AppxDesktopClient, Windows-1252 (default) encoding, you enter a Euro symbol, EUR (alt+0128) into a field and save the record. The associated number value of the Euro symbol for the 1252 schema is 128, see Windows-1252 table. The Appx engine, set to use ISO-8859-15 (default), stores the character value 128. Note that a 128 in the ISO-8859-15 table is not a Euro symbol. Even so, the Euro symbol is displayed in your Appx Application field. That's because your desktop is using the 1252 character set. If you looked at this same record on another desktop using a different character encoding schema, the character would be displayed using whatever symbol was associated with a value of 128 (probably not the Euro symbol).
To correct this you would simply set the second client to windows-1252 and start a new session. It's important to understand that the data on the server is not converted, but rather, the raw character value associated with the client encoding schema is maintained.
Taking this example one step further, let's say your Appx application was importing data directly into your application. If the character encoding of that data is different from that of your Appx client you might not see a true representation of that data when using the client. Keep in mind that the raw character encoding value is saved in your Appx file.
Recommendation: All AppxDesktopClients that connect to your Appx engine should be using the same character encoding. HTML Client The HTML client displays all data in UTF-8 encoding. The engine transcodes from it's default encoding of ISO-8859-15 to UTF-8 when sending data to the client, and from UTF-8 to ISO-8859-15 when receiving data from the client. If APPX_RAW_ENCODING is specified, it uses that instead of ISO-8859-15. Appx Engine In all Appx releases prior to 6.0 the Appx engine is a single byte processor and, by default, is set to use the ISO-8859-15 character set. Multi-byte characters from another source will be saved in Appx as raw data byte by byte. The programmer must accommodate for the potential character identification.
PDF output
The PDF font encoding default depends on the engine release. In 5.4.2, 5.4.3, 5.4.4c and 5.5.1 the PDF renderer passesauto to the PDF library unless APPX_PDF_ENCODING is set. In 6.2.2 Beta 2 it uses unicode unless that variable is set. Check the PDF output from your installed release when changing a font or an encoding.