Skip to content

Pass Through Unmodified String On Failure In Mapping Step#82

Merged
isomarcte merged 2 commits into
typelevel:mainfrom
isomarcte:correctly-handle-partially-mapped-input
Feb 15, 2023
Merged

Pass Through Unmodified String On Failure In Mapping Step#82
isomarcte merged 2 commits into
typelevel:mainfrom
isomarcte:correctly-handle-partially-mapped-input

Conversation

@isomarcte

Copy link
Copy Markdown
Member

Previously when we encountered a disallowed code point in the mapping step, we replaced it with the Unicode replacement character 0xfffd. This is because UTS-46 dictates that we should not render a string with disallowed code points back to the user.

However, the UTS-46 validation steps, which occur after the mapping step, require operating on the input with the disallowed code points in place.

To facilitate this, the MappingException has been changed to return both unsafePartiallyMappedInput and renderablePartiallyMappedInput values. unsafePartiallyMappedInput is the mapped input, but disallowed code points are left in place and should never be rendered to the user. renderablePartiallyMappedInput is the mapped input, with disallowed code points represented as 0xfffd.

Previously when we encountered a disallowed code point in the mapping step, we replaced it with the Unicode replacement character 0xfffd. This is because UTS-46 dictates that we should not render a string with disallowed code points back to the user.

However, the UTS-46 validation steps, which occur after the mapping step, require operating on the input with the disallowed code points in place.

To facilitate this, the `MappingException` has been changed to return both `unsafePartiallyMappedInput` and `renderablePartiallyMappedInput` values. `unsafePartiallyMappedInput` is the mapped input, but disallowed code points are left in place and should never be rendered to the user. `renderablePartiallyMappedInput` is the mapped input, with disallowed code points represented as 0xfffd.
In JRE8 `.flip` returns `Buffer` not the concrete buffer type, e.g. `IntBuffer`.
@isomarcte
isomarcte merged commit de55a41 into typelevel:main Feb 15, 2023
@isomarcte
isomarcte deleted the correctly-handle-partially-mapped-input branch February 15, 2023 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant