Repository navigation
Conversation
A file whose bytes are illegal in the current encoding was copied into the annotation. Under a C locale that made the message an invalid US-ASCII string. Those sources are now left to the original message.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #258.
When a source file contains bytes that are illegal in the current encoding, the annotation copied those bytes into the syntax error. Under
LC_ALL=Cthe message becomes an invalid US-ASCII string, so a later match on the error text raisesArgumentError. A UTF-16 file with a BOM is the case from the Ruby source-encoding specs: the annotation printed the raw0xFFbyte.SyntaxSuggest.callnow leaves that source alone, and an empty annotation is not prepended to the original message. A normal syntax error in a valid encoding is still annotated.Under
LC_ALL=C, the UTF-16 file's detailed message is valid US-ASCII and no longer contains0xFF. Specs: 171 examples, 0 failures. The executable version example compares against the syntax_suggest already loaded by this Ruby, which is 2.0.3, so it was not part of that count.