[DRAFT] UCS-2 needs to be UTF-16 now #68
Open
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.
UCS-2 as such is basically not implemented anywhere any more. It's all UTF-16, and I say we need to acknowledge that.
Regrettably, the variable-length encoding of UTF-16 won't work for us because we need fixed lengths für the strings in VOTable BINARY2. That's why I have a TODO in here.
We could require parsers to read the UTF-16 strings and identify surrogate pairs, but that would be terrible in all ways.
To get out of this fix, we could say that arraysize represents the encoded length rather than the number of unicode codepoints. I think I'd consider that reasonable.
Alternatively, we say "you can't have non-BMP characters in unicodeChar and hence no surrogate pairs. VOTable parsers must fail when they are asked to encode anything outside of the BMP or containing surrogate characters". Hm 💩. For clarity, let me stress that basically all emojis are outside of the BMP.
See also https://wiki.ivoa.net/internal/IVOA/InterOpJune2025Apps/unicode-notes.pdf and bug #69.