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

wrong string encoding #1

Closed
changtimwu opened this issue Nov 29, 2011 · 3 comments
Closed

wrong string encoding #1

changtimwu opened this issue Nov 29, 2011 · 3 comments
Assignees

Comments

@changtimwu
Copy link

Encoding of the returned strings are "ASCII-8BIT". This causes problems if the string needs further manipulation.
The following code block illustrates the problem

# encoding: UTF-8
require 'ropencc'
s = Ropencc.conv('simp_to_trad', '"忧郁")
puts s #OK
puts "#{s}"  # ERROR

error message
incompatible character encodings: UTF-8 and ASCII-8BIT (Encoding::CompatibilityError)


Currently, s.force_encoding("UTF-8") could be used as a quick fix.

@ghost ghost assigned Psli Nov 30, 2011
@Psli
Copy link
Owner

Psli commented Nov 30, 2011

稍后发布一个新版本

Psli added a commit that referenced this issue Nov 30, 2011
@Psli
Copy link
Owner

Psli commented Nov 30, 2011

好了

@Psli Psli closed this as completed Nov 30, 2011
@changtimwu
Copy link
Author

Good!

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

No branches or pull requests

2 participants