Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Hide UTF-16 assumptions in the API. #13

Merged
merged 3 commits into from
Nov 15, 2019
Merged

Hide UTF-16 assumptions in the API. #13

merged 3 commits into from
Nov 15, 2019

Conversation

lrhn
Copy link
Contributor

@lrhn lrhn commented Nov 15, 2019

Make the API less dependent on the underlying data being a String/UTF-16 code unit sequence.

lrhn added 2 commits November 15, 2019 13:11
…F-16 code units.

In this case, don't return `codeUnits` as a list of integers, but explicitly say `utf16CodeUnits` and return them as an iterable. That can be implemented as efficiently as possible on, say, a UTF-8 byte array.
@lrhn lrhn requested a review from mit-mit November 15, 2019 12:16
@lrhn lrhn changed the title Hide utf16. Hide UTF-16 assumptions in the API. Nov 15, 2019
@lrhn lrhn merged commit ee745fe into master Nov 15, 2019
@mit-mit mit-mit deleted the hide-utf16 branch May 26, 2020 17:13
mit-mit added a commit to mit-mit/characters that referenced this pull request Jul 26, 2021
mosuem pushed a commit to dart-lang/core that referenced this pull request Oct 14, 2024
* Avoid the API depending on the underlying data being random-access UTF-16 code units.

In this case, don't return `codeUnits` as a list of integers, but explicitly say `utf16CodeUnits` and return them as an iterable. That can be implemented as efficiently as possible on, say, a UTF-8 byte array.

* Also use .characters in rest of example.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants