2639 – Hex and octal string values not completely specified

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 2639 - Hex and octal string values not completely specified
Summary: Hex and octal string values not completely specified
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dlang.org (show other issues)
Version: D2
Hardware: x86 All
: P2 normal
Assignee: No Owner
URL: http://www.digitalmars.com/d/2.0/lex....
Keywords: spec
: 3784 (view as issue list)
Depends on:
Blocks:
Reported: 2009年02月01日 12:41 UTC by Jerry Quinn
Modified: 2015年06月09日 01:21 UTC (History)
1 user (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Jerry Quinn 2009年02月01日 12:41:22 UTC
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 Jerry Quinn 2009年02月01日 12:44:32 UTC
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 Jerry Quinn 2010年02月08日 19:22:40 UTC
*** Issue 3784 has been marked as a duplicate of this issue. ***


AltStyle によって変換されたページ (->オリジナル) /