Crash my webserver!

Andrea Fontana nospam at example.org
Sun May 14 15:52:42 UTC 2023


On Sunday, 14 May 2023 at 14:57:07 UTC, Vladimir Panteleev wrote:
> On Sunday, 14 May 2023 at 13:53:49 UTC, Andrea Fontana wrote:
>> The UTF problem is actually a catched UTFException thrown by 
>> urlencode/decode of std library.
>
> This doesn't throw for me:
>
> ```d
> void main()
> {
> 	import std.uri;
> 	decode("\xFF");
> 	encode("\xFF");
> }
> ```
>
> But... looking at the implementation, it does have a baked-in 
> UTF-8 decoder, which is a little ridiculous. `decode` actually 
> decodes percent-encoded UTF-8, and then encodes it back, but 
> makes no attempt to validate the non-encoded parts of the 
> string. The module is pretty old though, so maybe it predates 
> the facilities in `std.utf`.

You mean %ff not \xff!

Andrea


More information about the Digitalmars-d mailing list