Kbase P124746: Plain-text reports containing a mixture of English and multi-byte characters cause columns not to al
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  05/07/2007 |
|
Status: Unverified
FACT(s) (Environment):
All Supported Operating Systems
Progress 6.x
Progress 7.x
Progress 8.x
Progress 9.x
OpenEdge 10.x
SYMPTOM(s):
Plain-text reports containing a mixture of English and multi-byte characters cause columns not to align correctly when displayed or printed.
Viewing or printing plain-text reports containing a mixture of single-byte and double-byte characters cause misalignment of columns.
Reports using UTF-8 fonts don't align correctly.
Reports are output from Progress using 4GL commands like OUTPUT TO, EXPORT, DISPLAY etc.
CAUSE:
Having columns align correctly when printing or viewing plain-text files require that all characters have consistent and predictable character widths. E.g. A double-byte character has exactly the same width as two English characters.
More often than not, this is not the case even with fixed-width fonts.
Character widths are governed by the font being used and therefore character widths are not something that Progress can control, other than giving you the opportunity to change the font itself.
The problem with UTF-8 fonts is that the % size increase of multi-byte characters over the same font's single-byte characters are often not in multiples of single-byte characters, and they even differ between fonts.
For example, with the "Courier New" font a Chinese character is almost the size of two English characters whereas the the "Courier" font's Chinese characters are only slightly wider than a single English character.
Generally, multi-byte characters are displayed larger than English characters, therefore you will find that Progress calculates that each multi-byte character may take up two (possibly more) single-byte places. i.e. A single multi-byte character may be the same size as exactly two (maybe more) English characters.
FIX:
Find and use a font that best suits the language being used, and that has multi-byte character widths that are exact multiples of English characters.
For example, if using Chinese you could use the SimSun font where each Chinese character is exactly equal to two English characters.
Another solution would be to use a 3rd party reporting tool rather than plain-text files, where column values can be placed at specific locations graphically and widths can be governed by the reporting tool. This is different to plain-text files where the position of a column is based upon the width of the column(s) that have preceded it.