www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - std.uri bugs?

reply k.inaba <k.inaba_member pathlink.com> writes:
1.
The document comment for the std.uri.decode() function states
 Escape sequences that resolve to valid URI characters are not replaced.
but decode("%41%42%43") returns "ABC". ('A', 'B', and 'C' seems to be valid URI characters, but replaced.) Maybe this behaviour is intended, and the document should be corrected? 2. The std.uri module internally allocates temporary buffers by alloca() on stack. But this causes a problem when one deals with large strings: import std.uri; void main() { char[] str = new char[10000000]; // about 10MB str[] = 'A'; encodeComponent(str); } This example halts on "Error: Stack Overflow" on my WinXP+dmd 1.42 environment. All allocas in this module should be rewritten to heap allocation, i think. Or at least, this limitation should be noted in the document.
Jan 05 2006
parent "Walter Bright" <newshound digitalmars.com> writes:
"k.inaba" <k.inaba_member pathlink.com> wrote in message 
news:dpjmhp$2hcp$1 digitaldaemon.com...
 1.
 The document comment for the std.uri.decode() function states
 Escape sequences that resolve to valid URI characters are not replaced.
but decode("%41%42%43") returns "ABC". ('A', 'B', and 'C' seems to be valid URI characters, but replaced.) Maybe this behaviour is intended, and the document should be corrected?
I think the doc is wrong here. I'll fix it.
Jan 08 2006