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

raspell dosn't return valid encodings (ruby 1.9) #5

Open
ctrochalakis opened this issue Jan 2, 2012 · 2 comments
Open

raspell dosn't return valid encodings (ruby 1.9) #5

ctrochalakis opened this issue Jan 2, 2012 · 2 comments

Comments

@ctrochalakis
Copy link

raspell suggest method returns asci-8bit strings instead of the correct encoding that was requested.

# -*- encoding : utf-8 -*-
require 'raspell'

w = "πράσυνο"
as = Aspell.new('el_GR', nil, nil, 'utf-8')
res = as.suggest(w)
p res
p res.first.encoding

Prints:

["\xCF\x80\xCF\x81\xCE\xAC\xCF\x83\xCE\xB9\xCE\xBD\xCE\xBF", "\xCF\x80\xCF\x81\xCE\xAC\xCF\x83\xCE\xB9\xCE\xBD\xCF\x8C", "\xCF\x80\xCF\x81\xCE\xAC\xCF\x83\xCE\xB9\xCE\xBD\xCE\xBF\xCF\x82", "\xCF\x80\xCF\x81\xCE\xAC\xCF\x83\xCE\xB9\xCE\xBD\xCE\xBF\xCF\x85", "\xCF\x80\xCF\x81\xCE\xB1\xCF\x83\xCE\xAF\xCE\xBD\xCE\xBF\xCF\x85", "\xCF\x80\xCF\x81\xCE\xAC\xCF\x83\xCE\xB9\xCE\xBD\xCE\xBF\xCE\xB9", "\xCE\xA0\xCF\x81\xCE\xB1\xCF\x84\xCE\xAF\xCE\xBD\xCE\xBF", "\xCE\xB8\xCF\x81\xCE\xB1\xCF\x83\xCF\x8D\xCE\xBD\xCF\x89", "\xCF\x80\xCF\x81\xCE\xAC\xCF\x83\xCE\xB9\xCE\xBD\xCE\xB1", "\xCF\x80\xCF\x81\xCE\xAC\xCF\x83\xCE\xB9\xCE\xBD\xCE\xB5", "\xCF\x80\xCF\x81\xCE\xAC\xCF\x83\xCE\xB9\xCE\xBD\xCE\xB7", "\xCF\x80\xCF\x81\xCE\xAC\xCF\x83\xCE\xBF\xCE\xBD", "\xCF\x80\xCF\x81\xCE\xB1\xCF\x83\xCE\xB9\xCF\x8E\xCE\xBD", "\xCF\x80\xCF\x81\xCE\xAC\xCF\x83\xCE\xBF", "\xCF\x80\xCF\x81\xCE\xAC\xCF\x83\xCE\xB9\xCE\xBD\xCF\x89\xCE\xBD", "\xCF\x80\xCF\x81\xCE\xB1\xCF\x83\xCE\xAF\xCE\xBD\xCF\x89\xCE\xBD", "\xCF\x80\xCF\x81\xCE\xB1\xCE\xB0\xCE\xBD\xCF\x89"]
#<Encoding:ASCII-8BIT>
@evan
Copy link
Owner

evan commented Jan 2, 2012

I don't personally use Raspell anymore so mostly I curate pull requests...patches welcome, if you can figure it out.

@ctrochalakis
Copy link
Author

Fair enough. As a quick fix, I force encode the results to utf-8.

I 'll see if I can write a patch for it.

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