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

common: utf8 and old gcc breakage on RHEL6.5 #4687

Merged
merged 2 commits into from Jul 10, 2015

Conversation

smithfarm
Copy link
Contributor

http://tracker.ceph.com/issues/7387

Pull request for hammer backport -> could someone w/permissions please set labels and milestone

tserong and others added 2 commits May 15, 2015 12:24
When the python CLI is given non-ASCII characters, it converts them to
\uHHHH escapes in JSON.  json_spirit parses these internally into 16 bit
characters, which could only work if json_spirit were built to use
std::wstring, which it isn't; it's using std::string, so the high byte
ends up being zero'd, leaving the low byte which is effectively garbage.

This hack^H^H^H^H change makes json_spirit convert to utf8 internally
instead, which can be stored just fine inside a std::string.

Note that this implementation still assumes \uHHHH escapes are four hex
digits, so it'll only cope with characters in the Basic Multilingual
Plane.  Still, that's rather a lot more characters than it could cope
with before ;)

(For characters outside the BMP, Python seems to generate escapes in the
form \uHHHHHHHH, i.e. 8 hex digits, which the current implementation
doesn't expect to see)

Fixes: ceph#7387

Signed-off-by: Tim Serong <tserong@suse.com>
(cherry picked from commit 8add15b)
Fixes: ceph#11574
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 6b68b27)
@ghost ghost added bug-fix core labels May 15, 2015
@ghost ghost added this to the hammer milestone May 15, 2015
@ghost ghost self-assigned this May 15, 2015
@ghost ghost mentioned this pull request Jun 7, 2015
@theanalyst theanalyst changed the title Malformed JSON command output when non-ASCII strings are present utf8 and old gcc breakage on RHEL6.5 Jun 7, 2015
@theanalyst
Copy link
Member

@ktdreyer This has passed the first round of integration tests for hammer at http://tracker.ceph.com/issues/11990#teuthology-run-commit-3677fd2708856587ac76fde086d1a4f7a20339a8-hammer-backports-June-15 Do you think it is ready for merge?

@tchaikov
Copy link
Contributor

👍

tchaikov added a commit that referenced this pull request Jul 10, 2015
utf8 and old gcc breakage on RHEL6.5

Reviewed-by: Kefu Chai <kchai@redhat.com>
@tchaikov tchaikov merged commit e3b1f7b into ceph:hammer Jul 10, 2015
@ghost ghost changed the title utf8 and old gcc breakage on RHEL6.5 common: utf8 and old gcc breakage on RHEL6.5 Aug 4, 2015
@jan--f jan--f deleted the wip-7387-hammer branch February 8, 2017 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants