Encoding issue with Apache POI

≯℡__Kan透↙ 提交于 2019-12-06 05:09:20

Problem SOLVED

It's quite funny when you try to debug problem for some time and then find the answer just after posting on stackoverflow :) Anyway problem was here:

String data = URLEncoder.encode(someString);
String data2 = URLDecoder.decode(data, "UTF-8");

So while working on localhost with App Engine Local Server data == data2, but on production server data != data2 and the difference are special characters which are encoded as question marks.

// solution
String data = URLEncoder.encode(someString, "UTF-8");
String data2 = URLDecoder.decode(data, "UTF-8");
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!