-
Notifications
You must be signed in to change notification settings - Fork 395
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
[BUG] StringReader.readUnquotedString()
does not support non-ASCII characters
#103
Comments
Unquoted strings are intentionally only a certain set of characters, anything beyond those are considered "special characters" and require quoted strings This is to avoid unquoted strings greedily parsing things that are meant to be parsed as other syntax |
Would you mind elaborating on the second point please? I can't think of a case where parsing special characters may unintentionally greedily parse arguments. Even if that was the case, it seems like a abuse of It also seems extremely unintuitive that "топчик" will be rejected, it doesn't really contain any "special characters" that will need to be avoided to prevent greedy parsing. |
I agree that it should be expanded to better support international text. Unquoted strings are used in SNBT values in compounds, where the character after could be either a |
I believe that it is necessary to add support for at least Cyrillic, since many servers in post-Soviet countries use Cyrillic commands and a lot of players complain that they have to write |
Signed-off-by: astro-angelfish <[email protected]>
I'm the maintainer of Chimera, a library that allows the Brigadier command framework to be used in Spigot plugins. Recently, a developer opened an interesting issue in which they reported that argument parsing failed when non-ASCII characters were specified.
Looking into the issue, the cause of the argument parsing failing for non-ASCII characters can be traced to:
This affects
StringArgumentType.word()
,StringArgumentType.string()
,StringReader.readString()
andStringReader.readUnquotedString()
and any other dependencies on these classes/methods.Maybe I'm missing some context but it seems weird to only allow a small subset of ASCII characters. In my opinion, this implementation of
StringReader.readUnquotedString()
is extremely wonky and should be refactored to support non-ASCII characters.In the interim, I decided to create a simple utility method that reads strings until a whitespace is encountered. It behaves similarly to
StringReader.readUnquotedString()
while supporting special characters.Source
The text was updated successfully, but these errors were encountered: