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

Documentation editor does not allow saving Unicode Supplementary Characters #1775

Open
srutzky opened this issue Jul 3, 2019 · 7 comments

Comments

@srutzky
Copy link

commented Jul 3, 2019

I was editing the following page:

String.fromCodePoint()

and was attempting to add the actual character(s) returned by each statement in the existing inline comment to the right of each statement. This would greatly help readers more quickly comprehend the relationship between the input values and the actual behavior of the method. However, each time I tried to "Publish", I would get a "500 Internal Server Error" message. Figuring that the problem was most likely the Unicode characters (and even more likely the supplementary characters), I removed them and was finally able to publish the page.

The two code blocks in the Examples section should have appeared as follows:

String.fromCodePoint(42);       // "*"
String.fromCodePoint(65, 90);   // "AZ"
String.fromCodePoint(0x404);    // "\u0404" == "Є"
String.fromCodePoint(0x2F804);  // "\uD87E\uDC04" == "你"
String.fromCodePoint(194564);   // "\uD87E\uDC04" == "你"
String.fromCodePoint(0x1D306, 0x61, 0x1D307); // "\uD834\uDF06a\uD834\uDF07" == "𝌆a𝌇"
// String.fromCharCode() cannot return supplementary characters (i.e. code points
// 0x010000 - 0x10FFFF) by specifying their code point. Instead it requires the
// UTF-16 surrogate pair in order to return a supplementary character:
String.fromCharCode(0xD83C, 0xDF03); // "🌃" == Code Point U+1F303 "Night with
String.fromCharCode(55356, 57091);   // Stars" == "\uD83C\uDF03"

// String.fromCodePoint(), on the other hand, can return 4-byte supplementary characters,
// as well as the more common 2-byte BMP characters, by specifying their code point:
String.fromCodePoint(0x1F303); // or 127747 in decimal == "🌃"

I will attempt another update to at least add the U+0404 character, "Є", as that will also help narrow down if this bug is isolated to supplementary characters or not. I will add a comment with the results.

@srutzky srutzky changed the title Documentation editor does not allow saving certain Unicode Characters (maybe just Supplementary Characters) Documentation editor does not allow saving certain Unicode characters (maybe just supplementary characters) Jul 3, 2019

@srutzky

This comment has been minimized.

Copy link
Author

commented Jul 3, 2019

Success on saving U+0404 character: "Є". Next I will try "\uD87E\uDC04" == "你"

@srutzky

This comment has been minimized.

Copy link
Author

commented Jul 3, 2019

Adding the == "你" to the two relevant comments again produced the "500 Internal Server Error". So, it appears that the issue (so far) is isolated to supplementary characters.

@srutzky

This comment has been minimized.

Copy link
Author

commented Jul 3, 2019

Final comment (for now): I think the editor is attempting to translate / convert / do something with the supplementary character rather than just saving it. I had previously tried to specify the characters in question using HTML encoding (e.g. 🌃 ) but it just appeared as "🌃" in the Preview. I then realized that the & was being translated into & even when not in a code block. This is evident when I clicked on the Source button and it had already translated it. I then tried entering in 🌃 while in the "Source" view, and that did work when previewing. HOWEVER, it's a one-shot deal as it gets translated into the actual supplementary character when going back to the HTML view. So, I discarded my edit with the properly encoded characters because while it would work this one time for me, the next time someone edits the page, those encoded sequences would be translated into characters and the person would then get the "500 Internal Server Error" upon saving and most likely not know how to handle it (or not even know what was causing it). It would be really nice if HTML-encoded entities did not get translated 😸 .

@chrisdavidmills

This comment has been minimized.

Copy link
Collaborator

commented Jul 18, 2019

@schalkneethling again, this sounds like a platform issue rather than a docs issue. Is it ok if I pass this one over to you?

@srutzky

This comment has been minimized.

Copy link
Author

commented Jul 18, 2019

@chrisdavidmills Sorry, didn't know the preferred place to file it.

@chrisdavidmills

This comment has been minimized.

Copy link
Collaborator

commented Jul 18, 2019

@srutzky no problem at all! We are just happy you reported it, and are fine with rerouting it if needed.

@srutzky srutzky changed the title Documentation editor does not allow saving certain Unicode characters (maybe just supplementary characters) Documentation editor does not allow saving Unicode Supplementary Characters Jul 18, 2019

@schalkneethling

This comment has been minimized.

Copy link
Collaborator

commented Jul 18, 2019

@escattone Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.