August 29, 2007 [Issue 1450] New: Registry: invalid UTF-8 sequence | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=1450 Summary: Registry: invalid UTF-8 sequence Product: D Version: 1.020 Platform: PC OS/Version: Windows Status: NEW Severity: major Priority: P2 Component: Phobos AssignedTo: bugzilla@digitalmars.com ReportedBy: keystuffs@netscape.net I get this error when I use the function value_EXPAND_SZ: std.stdio.writefln(key.getValue("").value_EXPAND_SZ()); This is caused because the value returned is 2 characters too long. The function value_EXPAND_SZ use the function ExpandEnvironmentStringsA. In the documentation found here: http://msdn2.microsoft.com/en-us/library/ms724265.aspx, this function return the string length, plus terminating null character, plus one. This means that the variable "newValue" returned by value_EXPAND_SZ contains 2 extra characters. To resolve the bug, I changed the last line by: return newValue[0 .. newValue.length - 2]; -- |
September 29, 2007 [Issue 1450] Registry: invalid UTF-8 sequence | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=1450 bugzilla@digitalmars.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Comment #1 from bugzilla@digitalmars.com 2007-09-28 22:15 ------- Fixed dmd 1.021 and 2.004 -- |
Copyright © 1999-2021 by the D Language Foundation