assigning chars as one-byte is not possible in the case of German Umlaute
Original Reporter info from Mantis: Dr. Udo Rempe
-
Reporter name: Dr. Udo Rempe
Original Reporter info from Mantis: Dr. Udo Rempe
- Reporter name: Dr. Udo Rempe
Description:
If a variable sym is declared as char and assignment "sym := 'Ä' ;" follows, the character 'Ä' is stored in a two-byte string with the values #002, #195, #132 in the positions 0, 1, and 2. It is not stored as an ASCII-character with the ordinal value 142 or an ANSI-character with the ordinal value 196; but "sym := #196 ;" or "sym := #142 ;" remain possible. The same is the case in the other German "Umlaut"-letters. In string constants the "Umlaut"-characters are too stored as two bytes. Such difficulties occur in all German "Umlaut"-characters. If characters with ordinal values below 128 are used (English letters) they are stored as one-byte chars and such difficulties cannot be observed. Such difficulties do not occur in Turbo Delphi 6.0. But in Delphi 2010 the difficulties are even larger than in Lazarus.
The difficulties did not occur in the case
Additional information:
of using Lazarus in combination with Windows 7 but only in combination with Windows Vista. Since the char constant 'Ä' was treated as a two-byte string the assignment "sym := 'Ä' ;" was consequently treated as illegal. Probably the implementation of some compiler switch may be feasible to avoid such incompatibilities.
Mantis conversion info:
- Mantis ID: 18497