www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2639] New: Hex and octal string values not completely specified

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2639

           Summary: Hex and octal string values not completely specified
           Product: D
           Version: 2.023
          Platform: PC
               URL: http://www.digitalmars.com/d/2.0/lex.html
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: www.digitalmars.com
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: jlquinn optonline.net


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


-- 
Feb 01 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2639





------- Comment #1 from jlquinn optonline.net  2009-02-01 12:44 -------
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.


-- 
Feb 01 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2639



--- Comment #2 from Jerry Quinn <jlquinn optonline.net> 2010-02-08 19:22:40 PST
---
*** Issue 3784 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 08 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2639



--- Comment #3 from github-bugzilla puremagic.com 2012-01-22 22:21:26 PST ---
Commit pushed to
https://github.com/D-Programming-Language/d-programming-language.org

https://github.com/D-Programming-Language/d-programming-language.org/commit/15151c41c4b35deaa690e7e052f74fb8f9d56010
fix Issue 2639 - Hex and octal string values not completely specified

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 22 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2639


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 22 2012