Project

General

Profile

Feature #11138

Character buffer can contain bytes from more than one encoding

Added by Paul Bodale 6 months ago. Updated 6 months ago.

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

Related to Base Language - Bug #4766: fix CHR and ASC WIP

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:

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.

#2 Updated by Paul Bodale 6 months ago

  • Related to Bug #4766: fix CHR and ASC added

Also available in: Atom PDF