Comments (7)
Quick question: is that a with umlauts above correctly encoded using UTF-8, as declared (although using non-standard 'utf-8'; should be recognized nonetheless)? Not sure how github issues handles encoding...
If possible, can you add snippet as attachment?
from aalto-xml.
Yes, it is an ä http://en.wikipedia.org/wiki/Swedish_alphabet (second last character in the swedish alphabet).
It is encoded as a double byte character in utf-8.
https://gist.github.com/2338902 (xml)
https://gist.github.com/2338944 (junit)
It feels like it has to do with double byte character split in the middle. I does not seems to handle it when it is in an attribute value.
I forgot the stack trace in prior post.
java.lang.IllegalStateException: Internal error: should never execute this code path
at com.fasterxml.aalto.async.AsyncByteScanner.throwInternal(AsyncByteScanner.java:2936)
at com.fasterxml.aalto.async.AsyncUtfScanner.handleAttrValuePending(AsyncUtfScanner.java:1350)
at com.fasterxml.aalto.async.AsyncUtfScanner.handleAttrValue(AsyncUtfScanner.java:1136)
at com.fasterxml.aalto.async.AsyncByteScanner.handleStartElement(AsyncByteScanner.java:2149)
at com.fasterxml.aalto.async.AsyncByteScanner.nextFromTree(AsyncByteScanner.java:656)
at com.fasterxml.aalto.stax.StreamReaderImpl.next(StreamReaderImpl.java:720)
at net.jakeri.appstore.xml.AsyncXmlTest.testAsyncXml(AsyncXmlTest.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
from aalto-xml.
Thanks. Yes, I am familiar with 'ä' as character, and know it gets split, just wanted to verify it was due to multi-byte UTF-8, and not as (incorrect) reaction to decoding problem. I'll have a look; you are probably correct in that this is one unhandled edge case. Async parses has to store state correctly and this must be missing currentyl.
from aalto-xml.
Yup, can reproduce the issue.
from aalto-xml.
Fixed -- handling was indeed missing; now should work. I will also push out 0.9.8 release, as there are couple of other bug fixes.
from aalto-xml.
Nice one!
Thanks.
from aalto-xml.
Thank you for reporting this -- there are unfortunately some edge cases, but they are usually relatively easy to fix.
from aalto-xml.
Related Issues (20)
- Source bundles have no Bundle-SymbolicName in Manifest HOT 4
- XML Escape is not working HOT 1
- Can't use ENTITY_REFERENCE event for resolution in an Attribute HOT 3
- Support disabling General Entity Reference replacement in attribute values HOT 6
- XMLReaderImpl.getAttributeValue(String, String) does not ignore namespace if null HOT 1
- Add Java 9+ module info using Moditect HOT 1
- Reading full elements
- `BufferRecycler` access not safe if readers/writers used from different threads
- Support disabling namespace awareness HOT 1
- java.lang.NoClassDefFoundError: javax/xml/stream/events/XMLEvent HOT 2
- getLocation() doesn't count xml prolog for non-utf8 documents
- Add support for JEP-185 (JAXP-1.5) properties named ACCESS_EXTERNAL_
- Async parsing turns " inside element content into apostrophe HOT 4
- DTD RootName only returned correctly if it consists of a multiple of 4 bytes HOT 1
- `Attributes.getValue(String qName)` sometimes returns values from previous elements HOT 4
- `DataUtil.growArrayBy(arr, more)` is vulnerable to break the service. HOT 1
- ` textAccumulator.addText(buf, start, end)` introduces security issue. HOT 1
- Multi-byte characters are split in writeCData() if first byte sits right at the end of the buffer HOT 3
- Multi-byte characters are split in `writeComment()` if first byte sits right at the end of the buffer
- Multi-byte characters are split in `writePI()` if first byte sits right at the end of the buffer
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aalto-xml.