JsonParseException: Invalid UTF-8 start byte 0xbc
when I am post some data using curl:
curl 'http://localhost:28082/inapi/reportingXzxkBeta' -H 'HL-APP-KEY: CreditSharePortal' -H 'Origin: http://localhost:3801' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7' -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36' -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept: application/json, text/plain, */*' -H 'Referer: http://localhost:3801/main/reporting/reportXk' -H 'HL-CURRENT-URL: http://localhost:3801/main/reporting/reportXk' -H 'Cookie: cc-o-t-v3=4F315C6567FF8C7D9861AC62421F8536C6E7431D23C2A961A279698295C9427C88F5A35DDE872E2D545A2BCEFB2B836EBE71BA73B3D2E8BB27D275776D8C00B0E4EA7FDE501C09811CB553B6008EE49A; cc-email-v3=""' -H 'Connection: keep-alive' -H 'DNT: 1' --data-binary $'{"xzxdr":"ddd","ztLx":"护照","ztDm":"3445435243","xzxkJdswh":"34343","xkmc":"343434","zt":"正常","xknr":"d'd","xklb":"普通","fddbrxm":"ddd","xkjdrq":"2018-11-20","xkjzq":"2018-11-20","dfbm":"500000","orgName":"东方广","xklbmc":"普通"}' --compressed
When the server parse chinese words(ascii code is ok) throw this error:
JsonParseException: Invalid UTF-8 start byte 0xbc
when I am running this app in Liunx operation system(default operation system encode is UTF-8) on server it's ok. But when I am debugging on my Windows machine it break(Intellij Idea Ultimate + Java 8 + Embeded Tomcat).Maybe the operation system default encode GBK cause this problem.How to fix this? I am trying to add this config on application.properties.
spring.http.encoding.charset=UTF-8
spring.http.encoding.enabled=true
spring.http.encoding.force=true
But it don't work.
spring
add a comment |
when I am post some data using curl:
curl 'http://localhost:28082/inapi/reportingXzxkBeta' -H 'HL-APP-KEY: CreditSharePortal' -H 'Origin: http://localhost:3801' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7' -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36' -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept: application/json, text/plain, */*' -H 'Referer: http://localhost:3801/main/reporting/reportXk' -H 'HL-CURRENT-URL: http://localhost:3801/main/reporting/reportXk' -H 'Cookie: cc-o-t-v3=4F315C6567FF8C7D9861AC62421F8536C6E7431D23C2A961A279698295C9427C88F5A35DDE872E2D545A2BCEFB2B836EBE71BA73B3D2E8BB27D275776D8C00B0E4EA7FDE501C09811CB553B6008EE49A; cc-email-v3=""' -H 'Connection: keep-alive' -H 'DNT: 1' --data-binary $'{"xzxdr":"ddd","ztLx":"护照","ztDm":"3445435243","xzxkJdswh":"34343","xkmc":"343434","zt":"正常","xknr":"d'd","xklb":"普通","fddbrxm":"ddd","xkjdrq":"2018-11-20","xkjzq":"2018-11-20","dfbm":"500000","orgName":"东方广","xklbmc":"普通"}' --compressed
When the server parse chinese words(ascii code is ok) throw this error:
JsonParseException: Invalid UTF-8 start byte 0xbc
when I am running this app in Liunx operation system(default operation system encode is UTF-8) on server it's ok. But when I am debugging on my Windows machine it break(Intellij Idea Ultimate + Java 8 + Embeded Tomcat).Maybe the operation system default encode GBK cause this problem.How to fix this? I am trying to add this config on application.properties.
spring.http.encoding.charset=UTF-8
spring.http.encoding.enabled=true
spring.http.encoding.force=true
But it don't work.
spring
add a comment |
when I am post some data using curl:
curl 'http://localhost:28082/inapi/reportingXzxkBeta' -H 'HL-APP-KEY: CreditSharePortal' -H 'Origin: http://localhost:3801' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7' -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36' -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept: application/json, text/plain, */*' -H 'Referer: http://localhost:3801/main/reporting/reportXk' -H 'HL-CURRENT-URL: http://localhost:3801/main/reporting/reportXk' -H 'Cookie: cc-o-t-v3=4F315C6567FF8C7D9861AC62421F8536C6E7431D23C2A961A279698295C9427C88F5A35DDE872E2D545A2BCEFB2B836EBE71BA73B3D2E8BB27D275776D8C00B0E4EA7FDE501C09811CB553B6008EE49A; cc-email-v3=""' -H 'Connection: keep-alive' -H 'DNT: 1' --data-binary $'{"xzxdr":"ddd","ztLx":"护照","ztDm":"3445435243","xzxkJdswh":"34343","xkmc":"343434","zt":"正常","xknr":"d'd","xklb":"普通","fddbrxm":"ddd","xkjdrq":"2018-11-20","xkjzq":"2018-11-20","dfbm":"500000","orgName":"东方广","xklbmc":"普通"}' --compressed
When the server parse chinese words(ascii code is ok) throw this error:
JsonParseException: Invalid UTF-8 start byte 0xbc
when I am running this app in Liunx operation system(default operation system encode is UTF-8) on server it's ok. But when I am debugging on my Windows machine it break(Intellij Idea Ultimate + Java 8 + Embeded Tomcat).Maybe the operation system default encode GBK cause this problem.How to fix this? I am trying to add this config on application.properties.
spring.http.encoding.charset=UTF-8
spring.http.encoding.enabled=true
spring.http.encoding.force=true
But it don't work.
spring
when I am post some data using curl:
curl 'http://localhost:28082/inapi/reportingXzxkBeta' -H 'HL-APP-KEY: CreditSharePortal' -H 'Origin: http://localhost:3801' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7' -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36' -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept: application/json, text/plain, */*' -H 'Referer: http://localhost:3801/main/reporting/reportXk' -H 'HL-CURRENT-URL: http://localhost:3801/main/reporting/reportXk' -H 'Cookie: cc-o-t-v3=4F315C6567FF8C7D9861AC62421F8536C6E7431D23C2A961A279698295C9427C88F5A35DDE872E2D545A2BCEFB2B836EBE71BA73B3D2E8BB27D275776D8C00B0E4EA7FDE501C09811CB553B6008EE49A; cc-email-v3=""' -H 'Connection: keep-alive' -H 'DNT: 1' --data-binary $'{"xzxdr":"ddd","ztLx":"护照","ztDm":"3445435243","xzxkJdswh":"34343","xkmc":"343434","zt":"正常","xknr":"d'd","xklb":"普通","fddbrxm":"ddd","xkjdrq":"2018-11-20","xkjzq":"2018-11-20","dfbm":"500000","orgName":"东方广","xklbmc":"普通"}' --compressed
When the server parse chinese words(ascii code is ok) throw this error:
JsonParseException: Invalid UTF-8 start byte 0xbc
when I am running this app in Liunx operation system(default operation system encode is UTF-8) on server it's ok. But when I am debugging on my Windows machine it break(Intellij Idea Ultimate + Java 8 + Embeded Tomcat).Maybe the operation system default encode GBK cause this problem.How to fix this? I am trying to add this config on application.properties.
spring.http.encoding.charset=UTF-8
spring.http.encoding.enabled=true
spring.http.encoding.force=true
But it don't work.
spring
spring
asked Nov 20 '18 at 6:10
DolphinDolphin
1,02892551
1,02892551
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53387200%2fjsonparseexception-invalid-utf-8-start-byte-0xbc%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53387200%2fjsonparseexception-invalid-utf-8-start-byte-0xbc%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown