Skip to content

std_unicode::char::decode_utf16 should be in core #49319

Closed
@lambda-fairy

Description

@lambda-fairy
Contributor

The decode_utf16 function currently lives in the std_unicode crate. But, as far as I can tell, this function doesn't depend on any Unicode tables and has no reason to be in this crate.

I suggest moving this function (and its associated iterator) into the core crate. This will allow for decoding UTF-16 text under #![no_std] in stable Rust.

Activity

SimonSapin

SimonSapin commented on Mar 24, 2018

@SimonSapin
Contributor

I agree that there is no reason for this not to be in libcore. Feel free to submit a PR and ping me for review.

More generally I wonder if we can rely of various platforms’ linkers to remove unused tables, and if so if there’s any reason to keep std_unicode from core at all. But that doesn’t need to block moving decode_utf16 specifically.

added
C-enhancementCategory: An issue proposing an enhancement or a PR with one.
T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.
on Mar 24, 2018
SimonSapin

SimonSapin commented on Apr 5, 2018

@SimonSapin
Contributor

#49698 fixes this.

added a commit that references this issue on Apr 12, 2018

Auto merge of #49698 - SimonSapin:unicode-for-everyone, r=alexcrichton

d26f9e4

2 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @cuviper@SimonSapin@lambda-fairy

        Issue actions

          `std_unicode::char::decode_utf16` should be in `core` · Issue #49319 · rust-lang/rust