https://d.puremagic.com/issues/show_bug.cgi?id=10453
--- Comment #1 from Parke <[email protected]> 2013-11-27 14:21:45 PST --- Cross posting from D.learn: http://forum.dlang.org/thread/[email protected] TDPL, page 37, says: "Hex strings are useful for defining raw data; the compiler makes no attempt whatsoever to interpret the contents as Unicode characters or anything else but hexadecimal digits." But: static immutable (char[32]) s0 = x"0000"; // compiles static string s1 = x"cccc"; // compiles static immutable (char[]) s2 = x"cccc"; // compiles static immutable (char[32]) s3 = x"cccc"; // Error: Invalid trailing code unit static immutable (char[32]) s4 = x"cc"; // Error: Truncated UTF-8 sequence static immutable (ubyte[]) s5 = x"cccc"; // Error: cannot implicitly convert ... static immutable (ubyte[32]) s6 = x"cccc"; // Error: Invalid trailing code unit // Error: cannot implicitly convert ... "Invalid trailing code unit" and "Truncated UTF-8 sequence" certainly look like Unicode interpretation errors to me. (Of course, what I would really like to do is initialize a ubyte array with a hex string, preferably without a cast.) I cannot find any relevant documentation on either of these pages. http://dlang.org/lex.html http://dlang.org/arrays.html#strings Any advice would be appreciated. Thanks! -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
