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

Encoding problem with string format #1511

Closed
retoo opened this Issue Feb 18, 2014 · 3 comments

Comments

Projects
None yet
4 participants
@retoo
Copy link
Contributor

retoo commented Feb 18, 2014

String#% (string formatting) converts to wrong encoding when a %s is supplied with an integer.

x = "%s ä"
puts x.encoding
puts (x % 2).encoding

prints

UTF-8
US-ASCII
@retoo

This comment has been minimized.

Copy link
Contributor Author

retoo commented Feb 18, 2014

Workaround:

x = "%s ä"
puts (x % "" + 2.to_s).encoding

sh286 added a commit that referenced this issue Feb 19, 2014

@headius

This comment has been minimized.

Copy link
Member

headius commented Feb 20, 2014

Just to confirm, the PR referenced was never merged, right?

@sh286

This comment has been minimized.

Copy link
Member

sh286 commented Feb 20, 2014

No, I got a few specs failing when ran it on Travis.

@headius headius closed this in bbf8e8f Feb 20, 2014

@enebo enebo added this to the JRuby 1.7.11 milestone Feb 21, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.