-
-
Notifications
You must be signed in to change notification settings - Fork 146
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
Plugin is very fragile with respect to UTF-8 #4
Comments
@kittylyst Do you have a testcase for this? I'm not sure how to reproduce this. |
@bodiam It's been months since I looked at this, but if memory serves, the problem was caused by a \n character being incorrectly inserted by stupid line-wrapping software partway through a multibyte UTF-8 sequence. I don't have the test case to hand, as it came up during some client work which I don't have access to any more. A probable minimal test case is:
|
Hi @kittylyst , I've tried a simple test by opening this document: http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt I get a NPE in at apple.awt.CAccessible.getAccessibleContext(CAccessible.java:74), I only get partial rendering, but I don't see a crash. Would this be good enough for you? |
That is a significant torture test - if you're not seeing a crash & getting partial rendering from this, feel free to close this bug. |
It was the worst I could find ;-). I doesn't crash on my Mac, only partial rendering, but that seems good enough to fix the document. I'm in the process of releasing 0.2, which should be approved in 1-2 days. If you have a different OS than Mac, would you care to retest it? |
Thanks for the torture test. That's super useful. I'm going to see if I can get Asciidoctor core to drop invalid characters and only issue a warning so that it at least processes the file. |
If a .adoc contains incorrect UTF-8, it throws exceptions and does not display properly. Could this be made less of a hard crash - getting some output so I can find the bad UTF-8 in the document would be useful.
The text was updated successfully, but these errors were encountered: