-
Notifications
You must be signed in to change notification settings - Fork 15
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
Text encoding #12
Comments
What if you set |
Sure, I can get around it, but the point is that since all of the data is always in fact going to be UTF-8, the library should honour that. |
I guess that's right, as long as Xapian always stores/returns UTF-8. What should we do when storing? Should an exception be raised if the string is not UTF-8? |
I'm not sure how the Xapian bindings handle things, but if they just use the raw bytestream and assume it's UTF-8 (because, yes, Xapian alwas stores/returns in UTF-8) then you should probably call .encode('utf-8') and if there's a problem ruby will throw the exception for you :) |
Since all text in xapian is utf-8, strings coming back out of xapian-fu should be encoded in utf-8 (probably just by calling force_encoding('utf-8') on strings as they come out)
Right now the strings come out marked as local encoding, but are actually utf-8, and this causes some problems.
The text was updated successfully, but these errors were encountered: