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
Closed

Encoding problem with string format #1511

retoo opened this issue Feb 18, 2014 · 3 comments
Milestone

Comments

@retoo
Copy link
Contributor

@retoo 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
Copy link
Contributor Author

@retoo retoo commented Feb 18, 2014

Workaround:

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

lucasallan added a commit that referenced this issue Feb 19, 2014
Related to issue #1511
@headius
Copy link
Member

@headius headius commented Feb 20, 2014

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

@lucasallan
Copy link
Member

@lucasallan lucasallan 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
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants