Skip to content

Always encode gethostname result as UTF-8#6274

Merged
headius merged 1 commit intojruby:masterfrom
headius:utf8_hostname
Jun 15, 2020
Merged

Always encode gethostname result as UTF-8#6274
headius merged 1 commit intojruby:masterfrom
headius:utf8_hostname

Conversation

@headius
Copy link
Member

@headius headius commented Jun 9, 2020

Our gethostname backends on the JDK's socket API, which always
returns a decoded character string. Rather than try to pretend
that this decoding has not happened and stuff the string back into
a "binary" ASCII-8BIT string, we instead always normalize the
encoding to UTF-8, the default encoding for Ruby strings now.

Fixes #6156

Our gethostname backends on the JDK's socket API, which always
returns a decoded character string. Rather than try to pretend
that this decoding has not happened and stuff the string back into
a "binary" ASCII-8BIT string, we instead always normalize the
encoding to UTF-8, the default encoding for Ruby strings now.

Fixes jruby#6156
@headius headius added this to the JRuby 9.3.0.0 milestone Jun 9, 2020
@headius headius merged commit 0742c00 into jruby:master Jun 15, 2020
@headius headius deleted the utf8_hostname branch June 15, 2020 21:48
@headius headius modified the milestones: JRuby 9.3.0.0, JRuby 9.2.18.0 Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Socket.gethostname encoding still platform specific

1 participant