Bug 1450 – Registry: invalid UTF-8 sequence

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
phobos
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2007-08-29T08:54:00Z
Last change time
2014-02-16T15:23:55Z
Assigned to
bugzilla
Creator
keystuffs

Comments

Comment #0 by keystuffs — 2007-08-29T08:54:20Z
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];
Comment #1 by bugzilla — 2007-09-28T22:15:52Z
Fixed dmd 1.021 and 2.004