Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
ofbiz-directcontrolservlet
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
6bf4b8e8
authored
2016-10-13 12:18:51 -0500
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Fix some encoding issues, everything is now UTF-8.
Refs: #7877
1 parent
1696b6ea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
src/com/brainfood/ofbiz/DirectControlServlet.java
src/com/brainfood/ofbiz/DirectControlServlet.java
View file @
6bf4b8e
...
...
@@ -320,7 +320,7 @@ public class DirectControlServlet extends HttpServlet {
if
(
"application/json"
.
equals
(
contentType
))
{
// Read request body as JSON and insert into the context
Map
<
String
,
Object
>
items
=
UtilGenerics
.
cast
(
JSON
.
from
(
UtilIO
.
readString
(
new
FileReader
(
tmpFile
))).
toObject
(
Map
.
class
));
Map
<
String
,
Object
>
items
=
UtilGenerics
.
cast
(
JSON
.
from
(
UtilIO
.
readString
(
new
InputStreamReader
(
new
FileInputStream
(
tmpFile
),
"UTF-8"
))).
toObject
(
Map
.
class
));
for
(
Object
key
:
items
.
keySet
())
{
context
.
put
((
String
)
key
,
items
.
get
(
key
));
}
...
...
@@ -464,12 +464,12 @@ public class DirectControlServlet extends HttpServlet {
setResponseNoCache
();
if
(
"JSON"
.
equals
(
outputHandler
))
{
response
.
setContentType
(
"application/x-json"
);
response
.
setContentType
(
"application/x-json
;charset=UTF-8
"
);
PrintWriter
writer
=
response
.
getWriter
();
String
jsonStr
=
JSON
.
from
(
result
).
toString
();
response
.
setContentLength
(
jsonStr
.
getBytes
(
"UTF8"
).
length
);
response
.
setContentLength
(
jsonStr
.
getBytes
(
"UTF
-
8"
).
length
);
writer
.
write
(
jsonStr
);
writer
.
flush
();
writer
.
close
();
...
...
Please
register
or
sign in
to post a comment