GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [windows] WinRT projection: HSTRING marshalling lossy past BMP ASCII; ApplicationDataContainer.Values IMap unprojected · Issue #11614 · NativeScript/NativeScript

[windows] WinRT projection: HSTRING marshalling lossy past BMP ASCII; ApplicationDataContainer.Values IMap unprojected #11614

New issue
Copy link
New issue
Copy link
Open
Open
[windows] WinRT projection: HSTRING marshalling lossy past BMP ASCII; ApplicationDataContainer.Values IMap unprojected#11614
Copy link
Assignees
triniwiz

Description

@aleclarson
aleclarson
opened on Nov 4, 2026
Issue body actions

Environment

@nativescript/core 9.1.3 (pkg.pr.new runtime abae298/cbec98bb), packaged WinUI 3 MSIX (org.octanexplat.windows61), Windows 11 x64, {N} Windows runtime alpha.

Defects verified on the packaged runtime

1. WinRT HSTRING marshalling is lossy past BMP ASCII

Windows.ApplicationModel.DataTransfer.DataPackage.SetText accepts any JS string, but the JS↔HSTRING marshalling mangles non-BMP content:

  • Non-BMP code points return '?' per UTF-16 unit — writing '😀' reads back '??'; '🇯🇵' reads back '????'; 'clip--😀-🇯🇵-e\u0301-\u0000-end' reads back 'clip--??-????-e'-'.
  • U+0301 combining acute maps to a codepage quote/acute char.
  • Text truncates at the first U+0000 ('before\0after' reads back 'before').
  • The exact mojibake is nondeterministic across identical launches — a lone '😀' returned '??' on some launches and the real '😀' on others.
  • Clipboard.SetContent+Flush commits are racy: an immediate GetTextAsync can read null or stale content; a ~350 ms settle is required for deterministic read-after-write.

BMP ASCII round-trips exactly. The same JS string round-trips correctly through PathIO.WriteTextAsync/ReadTextAsync (file IO), so the loss is specific to the clipboard/string marshalling path, not general string handling.

2. ApplicationDataContainer.Values IMap surface is unprojected

Windows.Storage.ApplicationData.Current.LocalSettings.Values projects as an opaque handle — none of the IMap surface (HasKey, Lookup, Insert, Remove, First, Size) is callable; ApplicationSettings.getString throws TypeError: ... Values.HasKey is not a function and direct member calls are silent no-ops. Preferences can only be persisted through a JSON document + the working file APIs.

Happy to share the qualification fixture that produced the evidence (packaged MSIX launches mw1bskqo, mw1iafcb, mw1jqr1q).

Activity

  1. aleclarson commented on Nov 4, 2026

    @aleclarson
    aleclarson
    on Nov 4, 2026
    ContributorAuthor
    More actions

    Real-world impact:

    • "Copy to clipboard" corrupts international text and emoji. Any app with a copy button — chat messages, contact names in non-Latin scripts (Chinese, Japanese, Arabic, Cyrillic names), addresses, emoji reactions, invite links with unicode slugs — delivers mojibake to the user's clipboard. A Chinese user copying an address gets ?? instead of the address; an emoji-only copy comes back as ??.
    • Copy-then-paste races. SetContent+Flush doesn't settle before the next read — a user (or automation) that copies and immediately pastes in-app can get null/stale content. "Copy invite link" buttons that verify by re-reading are nondeterministically flaky.
    • ApplicationSettings — the canonical {N} preferences API — throws on first use. getString/setString are how real apps persist auth tokens, "remember me", theme/onboarding flags, and feature flags. Values.HasKey is not a function means the standard preference path is unusable; apps must hand-roll a JSON file through the working PathIO APIs instead — which is what we now do, but every stock {N} app hits this wall.
    • U+0000 truncation silently drops serialized payloads. Escaped/binary-ish text or serialized content containing NULs truncates without error — data loss that looks like success.

    The settings gap alone touches essentially every real {N} app on Windows; the clipboard loss hits any app with a copy feature serving non-ASCII users.

  2. triniwiz
    self-assigned this
    on Nov 4, 2026
  3. triniwiz
    added a commit that references this issue on Nov 6, 2026

    fix(windows): use the IMap members of LocalSettings.Values

    5513b7f
  4. triniwiz commented on Nov 6, 2026

    @triniwiz
    triniwiz
    on Nov 6, 2026
    Member
    More actions

    Update core to the pkg.pr.new 298c76d and the runtime to @nativescript/[email protected]

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

Metadata

Metadata

Assignees

  • @triniwiz
    triniwiz

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

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.