Bug 2639 – Hex and octal string values not completely specified
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dlang.org
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2009-02-01T12:41:00Z
Last change time
2015-06-09T01:21:01Z
Keywords
spec
Assigned to
nobody
Creator
jlquinn
Comments
Comment #0 by jlquinn — 2009-02-01T12:41:22Z
The spec implies that a string literal containing hex and octal values is assembled in UTF-8, but doesn't say so explicitly. The text says that hex and octal values can be used to build binary data. If you have something like:
dstring ds = "\U00101234\x7f"d
what are the actual bytes in the string ds? Without defining explicitly, it allows for
00 10 12 34 7f 00 00 00
on a big-endian machine as opposed to the probably intended
00 10 12 34 00 00 00 7f
Comment #1 by jlquinn — 2009-02-01T12:44:32Z
Also, if you define arbitrary binary data that is not valid utf-8, should an error reported when the 'd' suffix is processed by the compiler?
If the spec more clearly says that the stuff between quotes is treated as if a UTF-8 string is created before suffixes are applied, then I think it formalizes the intent.
Comment #2 by jlquinn — 2010-02-08T19:22:40Z
*** Issue 3784 has been marked as a duplicate of this issue. ***
Comment #3 by github-bugzilla — 2012-01-22T22:21:26Z