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

UTF8 issue #9

Open
ghost opened this issue May 19, 2016 · 3 comments
Open

UTF8 issue #9

ghost opened this issue May 19, 2016 · 3 comments

Comments

@ghost
Copy link

ghost commented May 19, 2016

jira-sync generally works well for me, except that a large proportion of tickets generate the error message:

Caught Encoding::CompatibilityError at '{"expand":"renderedF': incompatible encoding regexp match (ASCII-8BIT regexp with UTF-8 string)

This is probably my ruby environment rather than jira-sync itself, but I am not used to ruby and am having trouble tracking it down. The source is probably in the fact that the tickets concerned are generated using French keyboards and do contain such non-ASCII characters as <<. I have used rubymine to try and single-step, but have been defeated by the threading and failed to find where the regex is and the exception is thrown from. I've also tried grepping for 'renderedF' without success.

I am running on Centos 7 with ruby 2.0.0p598, and 'gem update' run on all local and system-wide gems.

@ghost
Copy link
Author

ghost commented May 19, 2016

The exception is thrown by the regex called from parse_string in JSON/Pure/parser.rb. It appears that this regex should handle special chars such as >> (\xab). I wonder if the source of the problem might be the body.force_encoding(UTF-8) at line 225 in HTTParty/request.rb, but simply commenting this out fails.

@ghost
Copy link
Author

ghost commented May 19, 2016

Appear to have 'fixed' this by hacking httparty/parser.rb to use multi_json with oj rather than json_pure:

def json MultiJson.use('oj') MultiJson.load(body) #JSON.parse(body, :quirks_mode => true, :allow_nan => true) end
Of course it may be that all I've done is got rid of the error messages! Will leave it running overnight and find out tomorrow..

@fleipold
Copy link
Contributor

Thanks for looking into this. I have seen similar issues and quite frankly I fear that httparty is not exactly the http client to use. I am thinking switching to a different client. Unfortunately the way backwards compatibility is handled in httpclient doesn't inspire confidence either.

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

1 participant