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 2 commits into from Jul 10, 2015


None yet
5 participants

smithfarm commented May 15, 2015

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

tserong and others added some commits May 1, 2015

json_spirit: use utf8 intenally when parsing \uHHHH
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: #7387

Signed-off-by: Tim Serong <>
(cherry picked from commit 8add15b)
json_sprit: fix the FTBFS on old gcc
Fixes: #11574
Signed-off-by: Kefu Chai <>
(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 referenced this pull request Jun 7, 2015


utf8 and old gcc breakage on RHEL6.5 #4890

@theanalyst theanalyst changed the title from Malformed JSON command output when non-ASCII strings are present to utf8 and old gcc breakage on RHEL6.5 Jun 7, 2015


This comment has been minimized.


theanalyst commented Jul 10, 2015

@ktdreyer This has passed the first round of integration tests for hammer at Do you think it is ready for merge?


This comment has been minimized.


tchaikov commented Jul 10, 2015


tchaikov added a commit that referenced this pull request Jul 10, 2015

Merge pull request #4687 from SUSE/wip-7387-hammer
utf8 and old gcc breakage on RHEL6.5

Reviewed-by: Kefu Chai <>

@tchaikov tchaikov merged commit e3b1f7b into ceph:hammer Jul 10, 2015

@ghost ghost changed the title from utf8 and old gcc breakage on RHEL6.5 to common: utf8 and old gcc breakage on RHEL6.5 Aug 4, 2015

@jan--f jan--f deleted the SUSE:wip-7387-hammer branch Feb 8, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment