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

Invalid UTF-8 sequence in argument error when calling json_encode() on sphinx record #33

Closed
rahil-geek opened this issue Jul 7, 2015 · 2 comments
Labels
status:to be verified Needs to be reproduced and validated.

Comments

@rahil-geek
Copy link

There is a bug in Yii2 Sphinx Package which is causing UTF-8 encoding issues.

This issue reported in detail on;
http://stackoverflow.com/questions/31266012/sphinx-invalid-utf-8-sequence-in-argument-error-when-calling-json-encode-on

@klimov-paul
Copy link
Member

Does using of plain PDO (without extension) for the Sphinx query works for you?

@klimov-paul klimov-paul added the status:to be verified Needs to be reproduced and validated. label Jul 9, 2015
@rahil-geek
Copy link
Author

The issue was solved finally. It was a not a bug in Yii extension, but some configuration issue in the sphinx.conf.
As @klimov-paul asked if the record is retrieved without using the Yii Sphinx query. And yes the problem was still faced even by querying with PDO.

By adding the correct set of codes into the charset_table option of an index in the config file, the issue can be resolved. It can take a bit of time to find which codes to choose from, but it will do just fine, if added correctly. One just need to know which characters set to choose from.

So after the configuration has been set up, and once index has been rotated, the insertions will be made in proper utf-8 format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:to be verified Needs to be reproduced and validated.
Projects
None yet
Development

No branches or pull requests

2 participants