Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 18458 - invalid utf on run.dlang.io causes server error #672

Open
wilzbach opened this issue Feb 18, 2018 · 4 comments
Open

Issue 18458 - invalid utf on run.dlang.io causes server error #672

wilzbach opened this issue Feb 18, 2018 · 4 comments

Comments

@wilzbach
Copy link
Member

Moved from https://issues.dlang.org/show_bug.cgi?id=18458

Actually anything (including) '\x80' will cause a server error.

import std.stdio : writeln;

void main()
{
writeln('\x80');
}

@wilzbach
Copy link
Member Author

The server reply is:

{
"statusMessage":"Invalid UTF-8 sequence (at index 1)",
"statusDebugMessage":"Invalid UTF sequence: 80x - Invalid UTF-8 sequence (at index 1)"
}

The frontend should definitely display these error messages.

I don't have time today to dig into this, but Vibe.d just serialized an Exception toString here (https://github.com/vibe-d/vibe.d/blob/a991c962f01c208384b325fbf5afa081337c5c24/web/vibe/web/rest.d#L287).

@aliak00
Copy link

aliak00 commented Feb 18, 2018

Slight alteration with bug description body: It's anything (including) and over \x80.

wilzbach added a commit to wilzbach/dlang-tour that referenced this issue Feb 19, 2018
@wilzbach
Copy link
Member Author

wilzbach commented Feb 19, 2018

FYI: #673, but I don't like the solution there.

The problem can be reproduced locally easily:

void main(string[] args)
{
	import std.stdio;
	// but not extended ASCII
	string line = "\xB5"; // [181]
	line.writeln; // works
        import std.range.primitives : front;
	line.front.writeln; // fails
}

@wilzbach
Copy link
Member Author

@wilzbach wilzbach changed the title Issue 18458 - writeln('\xff'); on run.dlang.org causes server error Issue 18458 - invalid utf on run.dlang.org causes server error Feb 19, 2018
@wilzbach wilzbach changed the title Issue 18458 - invalid utf on run.dlang.org causes server error Issue 18458 - invalid utf on run.dlang.io causes server error Feb 19, 2018
wilzbach added a commit to wilzbach/dlang-tour that referenced this issue Feb 24, 2018
wilzbach added a commit to wilzbach/dlang-tour that referenced this issue Feb 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants