Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
f843497f
You need to sign in or sign up before continuing.
Commit
f843497f
authored
Feb 14, 2011
by
Max Kanat-Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 609538: Make the JSON-RPC interface support UTF-8 when a recent version
of LWP is installed r=dkl, a=mkanat
parent
a4ae80a4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
JSONRPC.pm
Bugzilla/WebService/Server/JSONRPC.pm
+16
-1
global.js
js/global.js
+3
-1
No files found.
Bugzilla/WebService/Server/JSONRPC.pm
View file @
f843497f
...
...
@@ -27,8 +27,9 @@ use base qw(JSON::RPC::Server::CGI Bugzilla::WebService::Server);
use
Bugzilla::
Error
;
use
Bugzilla::WebService::
Constants
;
use
Bugzilla::WebService::
Util
qw(taint_data)
;
use
Bugzilla::
Util
qw(correct_urlbase trim)
;
use
Bugzilla::
Util
qw(correct_urlbase trim
disable_utf8
)
;
use
HTTP::
Message
;
use
MIME::
Base64
qw(decode_base64 encode_base64)
;
#####################################
...
...
@@ -59,6 +60,20 @@ sub create_json_coder {
# Override the JSON::RPC method to return our CGI object instead of theirs.
sub
cgi
{
return
Bugzilla
->
cgi
;
}
sub
response_header
{
my
$self
=
shift
;
# The HTTP body needs to be bytes (not a utf8 string) for recent
# versions of HTTP::Message, but JSON::RPC::Server doesn't handle this
# properly. $_[1] is the HTTP body content we're going to be sending.
if
(
utf8::
is_utf8
(
$_
[
1
]))
{
utf8::
encode
(
$_
[
1
]);
# Since we're going to just be sending raw bytes, we need to
# set STDOUT to not expect utf8.
disable_utf8
();
}
return
$self
->
SUPER::
response_header
(
@_
);
}
sub
response
{
my
(
$self
,
$response
)
=
@_
;
...
...
js/global.js
View file @
f843497f
...
...
@@ -123,7 +123,9 @@ function set_language( value ) {
// This basically duplicates Bugzilla::Util::display_value for code that
// can't go through the template and has to be in JS.
function
display_value
(
field
,
value
)
{
var
translated
=
BUGZILLA
.
value_descs
[
field
][
value
];
var
field_trans
=
BUGZILLA
.
value_descs
[
field
];
if
(
!
field_trans
)
return
value
;
var
translated
=
field_trans
[
value
];
if
(
translated
)
return
translated
;
return
value
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment