Skip to content

Bytes.ofString and urlEncode throw on a lone surrogate #110

Closed

Description

@dimensionscape

Encoding a string that holds a lone surrogate to UTF-8 throws "Invalid UTF16" in Bytes.ofString, StringTools.urlEncode and utf8_str(), while trace and Sys.print encode it. JavaScript and HashLink encode it (as U+FFFD or WTF-8) rather than throw.

Activity

  1. added 2 commits that reference this issue on Oct 15, 2026
    801db31
    e2749e5
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions