Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove support for UTF-16 and UTF-32 #335

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Herringway
Copy link
Member

UTF-16 and UTF-32 are so rarely used that the YAML devs are considering removing them from the spec entirely. For those who DO need this functionality, std.utf.toUTF8/toUTF16/toUTF32 covers it just as efficiently - we were eagerly converting under the hood anyways.

Notable public interface changes here:

  • Loader.fromBuffer is now a deprecated alias of Loader.fromString as they are effectively equivalent now.
    • This means void[] or ubyte[] cannot directly be loaded anymore. I've only seen one public codebase even using this functionality, and it had to cast strings to ubyte[] to do it.
  • Reader.encoding removed. Unsure if this was ever used.
  • Token.encoding removed. ditto.
  • toUTF8() was removed. Why was this public in the first place...?
  • Emitter no longer has a CharType template parameter (only supports UTF-8)

Pros:

  • We can drop our only dependency
  • Simplified reading/writing code
  • Less document copying (not part of this PR)
  • Small but noticeable reduction to compile time

Cons:

  • Breaks backwards compatibility, but hopefully not in a way that actually impacts anyone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant