Skip to content

fix: activate on Windows machines with a non-ASCII computer name - #37

Merged
TobbenTM merged 1 commit into
mainfrom
gaborone/moonbase-cpp-non-ascii-activation
Oct 5, 2026
Merged

TobbenTM merged 1 commit into
mainfrom
gaborone/moonbase-cpp-non-ascii-activation

Conversation

@TobbenTM

@TobbenTM TobbenTM commented Oct 5, 2026

Copy link
Copy Markdown
Member

On Windows the device name was read with GetComputerNameExA, so any non-ASCII computer name reached nlohmann::json as ANSI bytes and dump() threw type_error.316, failing online and offline activation; it is now read with GetComputerNameExW and transcoded to UTF-8 (also for the legacy resolver's name), with no device id changes since the host-name fallback and legacy id still hash the ANSI reading. A device name that is not UTF-8 now gets U+FFFD instead of failing the request, while a device id that is not UTF-8 is refused before anything is sent, because a repaired id would bind a license that cannot validate on the device. The JUCE controller no longer calls every non-Moonbase exception a connection problem: anything other than a transport's api_error is shown in its own words, a machine file that fails to generate says why, and exception text is decoded as UTF-8. http_transport::send now documents that a failed connection must be reported as api_error with status 0, and the docs describe the new error copy.

read_host_name() used GetComputerNameExA, which answers in the ANSI code
page, so a computer name like Björn-PC reached nlohmann::json as bytes that
are not UTF-8 and dump() threw type_error.316, failing both online and
offline activation. Read it with GetComputerNameExW and transcode to UTF-8
instead, in the default resolver and for the legacy resolver's device name.
No device id changes: the opt-in host-name fallback and the legacy id still
hash the ANSI reading.

The device name is only a label, so bytes in it that are not UTF-8 now
become U+FFFD rather than failing the request. A device id that is not
UTF-8 is refused before anything is sent, since a repaired id would bind a
license that cannot validate on the device.

The JUCE controller called every exception that was not a Moonbase error a
connection problem, which sends users and developers looking at the
network. Both bundled transports report a failed connection as api_error,
so anything else is now shown in its own words, and a machine file that
cannot be generated no longer claims the write failed. Exception text is
decoded as UTF-8 rather than through juce::String's ASCII constructor, and
http_transport::send documents the api_error contract.
@argos-ci

argos-ci Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Oct 5, 2026, 9:21 AM

@TobbenTM
TobbenTM merged commit 87816c4 into main Oct 5, 2026
20 checks passed
github-actions Bot pushed a commit that referenced this pull request Oct 5, 2026
## [4.7.1](v4.7.0...v4.7.1) (2026-10-05)

### Bug Fixes

* activate on Windows machines with a non-ASCII computer name ([#37](#37)) ([87816c4](87816c4))
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 4.7.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant