-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Windows 10 reports invalid UTF-8 on the poem in Ch12-02 #1307
Comments
maybe related to #1129 |
Ewwww. I'm going to leave this open for a little bit; we get one more check of the entire book before print and I want to make sure the nostarch ebook doesn't have this problem. I've noted this in #1321 which is where I'm keeping track of the last batch of changes we're going to ask for when we do this final review with nostarch. Thank you for the thorough bug report! |
I have the same problem and in my case it's not only the apostrophe.
is also throwing the error. |
Ok, I had someone copy paste from the nostarch pdf and it worked, so I don't think that has the problem. Pushing a fix for the online version in a bit. |
This isn't always recognized as UTF-8 on all platforms after copy-pasting. Fixes rust-lang#2606 Related to rust-lang#2539, rust-lang#1307, rust-lang#1533
I've encountered a fairly minor issue while going through Chapter 12. In 12-02, I copied the poem to follow along with the book example. However, the poem contains what Rust/Windows considers to be invalid UTF-8. The relevant part of the poem is below.
When running my code example that follows the code in the book, read_to_string() fails:
thread 'main' panicked at 'something went wrong reading the file: Custom { kind: InvalidData, error: StringError("stream did not contain valid UTF-8") }', libcore\result.rs:945:5
Using WSL on Win10, I tried to validate the text file like so:
iconv reported invalid UTF-8.
The offending character is the apostrophe, which is 0x92. When I switched all four apostrophes to 0x27 the code ran successfully. The change is simple (note the slightly different apostrophe):
The original version seems to work fine on my Mac, and iconv validated the UTF-8 successfully there. I believe this is a Windows-only issue.
The text was updated successfully, but these errors were encountered: