Feature #11138
Character buffer can contain bytes from more than one encoding
Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:
0%
billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
reviewer:
production:
No
env_name:
topics:
Related issues
History
#1 Updated by Paul Bodale 6 months ago
While working on task #4766 it was found that a character variable can hold bytes from multiple encodings:
DEF VAR str AS CHARACTER NO-UNDO. DEF VAR m AS RAW. str = CHR(164, "UTF-8", "ISO8859-1") + CHR(176, "IBM850", "ISO8859-1") + CHR(144, "ISO8859-1", "IBM850"). PUT-STRING(m, 1) = str. MESSAGE rawToHex(m). //C2 A4 F8 C9 00
Here are the helper functions for reference: Helper functions
The solution is to create a new class in FWD (e.g. EncodedString) that will be used in converting the expression if such an edge-case is found.