kobjects / kxml2

Small XmlPull compatible parser
MIT License
41 stars 21 forks source link

Fix serialization for beyond BMP, cleaner parsing, add tests #2

Closed mihnita closed 7 years ago

mihnita commented 7 years ago
stefanhaustein commented 7 years ago

Is the buffer issue the only actual bug? I think relying on "new" Character methods will break CLDC/MIDP compatibility. Not that I think there are many people who care, but I'd prefer if this would be a separate conscious step?

mihnita commented 7 years ago

"Is the buffer issue the only actual bug?"

No, not the only one. That was in parsing. There was also the serialization bug where a high-low surrogate ended up serialized as &#;&#; So U+1F648 (🙈) ended up as 🙈� instead of just 🙈

===

"will break CLDC/MIDP compatibility."

Thanks, I was not aware of that. Is there an easy way to check for that? For instance some build-time flags?

===

"I'd prefer if this would be a separate conscious step?"

Sure, will do. I will send you two separate patches.

And you can reject the second one :-) But have it there "for posterity", might come in handy at some point, and it might serve as documentation for "that's how it's done, but can't because CLDC / MIDP" :-)

mihnita commented 7 years ago

Created separate pull request, not using the Character surrogate methods that don't exist in CLDC / MIDP.