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

os: assume UTF-8 for hostname #27849

Closed
wants to merge 1 commit into from
Closed

Commits on May 24, 2019

  1. os: assume UTF-8 for hostname

    Do not assume Latin-1, but rather UTF-8 for the result of getting the
    OS hostname.
    
    While in 99 % of cases these strings are stored in ASCII, the OS does
    not enforce an encoding on its own, and apparently the hostname is
    sometimes set to non-ASCII data (despite at least some versions of
    hostname(1) rejecting such input, making it even harder to write a
    test for this which would already require root privileges).
    
    In any case, these are short strings, so assuming UTF-8 comes
    with no significant overhead.
    
    Fixes: nodejs#27848
    addaleax committed May 24, 2019
    Configuration menu
    Copy the full SHA
    a1f81ed View commit details
    Browse the repository at this point in the history