uh, simply, we need to check that the input string is valid WTF-8.
Bug 1523440 Comment 2 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
~~uh, simply, we need to check that the input string is valid WTF-8.~~ Apparently not. this is an issue between UTF-8 vs WTF-8, that the internal supposes it's UTF-8 while API is for WTF-8