akof1314 / CoolFormat

CoolFormat Source Code Formatter
http://blog.csdn.net/akof1314/article/details/5355948
539 stars 147 forks source link

关于Json带中文出现“?????”这种 #43

Open zjt613 opened 6 years ago

zjt613 commented 6 years ago

求解

akof1314 commented 6 years ago

是哪个版本呢,测试文本可以提供下吗?

zjt613 commented 6 years ago

可以的 3.4 ,3.5都试过了。如下是测试用例。

{"showapi_res_error":"","showapi_res_code":0,"showapi_res_body":{"allNum":1478,"contentlist":[{"listing_date":"1992-07-22","ct":"2016-10-16 15:40:05.647","state":1,"mgjzc":"4.540188","name":"神奇B股","pinyin":"sqg","totalcapital":"53407.1628","code":"900904","stockType":"B","currcapital":"5475.165","profit_four":"1.6460","market":"sh"},{"listing_date":"2017-10-25","ct":"2017-10-13 09:02:02.157","state":1,"mgjzc":"4.574538","name":"阿科力","pinyin":"akl","totalcapital":"8670","code":"603722","stockType":"A","currcapital":"2170","profit_four":"0.2994","market":"sh"},{"listing_date":"1999-04-22","ct":"2016-10-16 15:37:40.314","state":1,"mgjzc":"4.265299","name":"中国巨石","pinyin":"zgjs","totalcapital":"291858.9041","code":"600176","stockType":"A","currcapital":"291858.9041","profit_four":"21.4985","market":"sh"},{"listing_date":"2015-03-19","ct":"2016-10-16 15:39:51.041","state":1,"mgjzc":"4.370309","name":"立霸股份","pinyin":"lbgf","totalcapital":"16000","code":"603519","stockType":"A","currcapital":"16000","profit_four":"0.8035","market":"sh"},{"listing_date":"2002-08-09","ct":"2016-10-16 15:38:32.161","state":1,"mgjzc":"2.899560","name":"天华院","pinyin":"thy","totalcapital":"41063.6024","code":"600579","stockType":"A","currcapital":"41063.6024","profit_four":"-0.0915","market":"sh"},{"listing_date":"1993-01-05","ct":"2016-10-16 15:38:37.962","state":1,"mgjzc":"1.605542","name":"复旦复华","pinyin":"fdfh","totalcapital":"68471.201","code":"600624","stockType":"A","currcapital":"68471.201","profit_four":"0.2769","market":"sh"},{"listing_date":"1998-06-16","ct":"2016-10-16 15:37:36.515","state":1,"mgjzc":"7.729408","name":"建发股份","pinyin":"jfgf","totalcapital":"283520.053","code":"600153","stockType":"A","currcapital":"283520.053","profit_four":"31.7069","market":"sh"},{"listing_date":"1993-07-26","ct":"2016-10-16 15:40:06.717","state":1,"mgjzc":"8.967820","name":"外高B股","pinyin":"wgbg","totalcapital":"113534.9124","code":"900912","stockType":"B","currcapital":"20055.75","profit_four":"4.4758","market":"sh"},{"listing_date":"2012-05-07","ct":"2016-10-16 15:39:48.813","state":1,"mgjzc":"2.730373","name":"明星电缆","pinyin":"mxdl","totalcapital":"52000.5","code":"603333","stockType":"A","currcapital":"52000.5","profit_four":"0.1688","market":"sh"},{"listing_date":"2002-02-07","ct":"2016-10-16 15:38:32.828","state":1,"mgjzc":"15.738802","name":"海螺水泥","pinyin":"hlsn","totalcapital":"529930.2579","code":"600585","stockType":"A","currcapital":"399970.2579","profit_four":"123.7015","market":"sh"},{"listing_date":"1993-06-29","ct":"2016-10-16 15:38:42.367","state":1,"mgjzc":"2.764847","name":"哈药股份","pinyin":"hygf","totalcapital":"254495.3276","code":"600664","stockType":"A","currcapital":"249272.8276","profit_four":"4.0698","market":"sh"},{"listing_date":"2010-03-29","ct":"2016-10-16 15:39:23.010","state":1,"mgjzc":"2.836748","name":"重庆水务","pinyin":"cqsw","totalcapital":"480000","code":"601158","stockType":"A","currcapital":"480000","profit_four":"13.0899","market":"sh"},{"listing_date":"2017-05-11","ct":"2017-05-12 04:10:21.393","state":1,"mgjzc":"5.585106","name":"金能科技","pinyin":"jnkj","totalcapital":"67593.9455","code":"603113","stockType":"A","currcapital":"7730","profit_four":"8.0963","market":"sh"},{"listing_date":"2004-07-07","ct":"2016-10-16 15:39:15.583","state":1,"mgjzc":"5.154684","name":"建设机械","pinyin":"jsjx","totalcapital":"63676.4203","code":"600984","stockType":"A","currcapital":"53882.8854","profit_four":"1.0089","market":"sh"},{"listing_date":"2003-03-25","ct":"2016-10-16 15:37:23.563","state":1,"mgjzc":"3.393255","name":"四川路桥","pinyin":"sclq","totalcapital":"361052.551","code":"600039","stockType":"A","currcapital":"301973.2672","profit_four":"9.0437","market":"sh"},{"listing_date":"1997-06-27","ct":"2016-10-16 15:37:30.038","state":1,"mgjzc":"7.046725","name":"同方股份","pinyin":"tfgf","totalcapital":"296389.8951","code":"600100","stockType":"A","currcapital":"296389.8951","profit_four":"-9.7950","market":"sh"},{"listing_date":"2015-05-29","ct":"2016-10-16 15:39:41.530","state":1,"mgjzc":"7.576917","name":"XD石大胜","pinyin":"xdsds","totalcapital":"20268","code":"603026","stockType":"A","currcapital":"14042.7554","profit_four":"1.6720","market":"sh"},{"listing_date":"1996-05-28","ct":"2016-10-16 15:38:46.842","state":1,"mgjzc":"4.655694","name":"三安光电","pinyin":"sagd","totalcapital":"407842.4928","code":"600703","stockType":"A","currcapital":"407842.4928","profit_four":"30.4847","market":"sh"},{"listing_date":"2015-12-22","ct":"2016-10-16 15:40:02.274","state":1,"mgjzc":"4.732067","name":"中新科技","pinyin":"zxkj","totalcapital":"30015","code":"603996","stockType":"A","currcapital":"10327.5","profit_four":"1.2672","market":"sh"},{"listing_date":"2016-12-07","ct":"2016-12-08 04:12:59.078","state":-1,"mgjzc":"8.863977","name":"XD三维股","pinyin":"xdswg","totalcapital":"12698","code":"603033","stockType":"A","currcapital":"5530","profit_four":"0.5712","market":"sh"},{"listing_date":"2015-05-18","ct":"2016-10-16 15:39:51.707","state":1,"mgjzc":"4.711382","name":"普莱柯","pinyin":"plk","totalcapital":"32374","code":"603566","stockType":"A","currcapital":"16361.418","profit_four":"1.2422","market":"sh"},{"listing_date":"1994-01-28","ct":"2016-10-16 15:39:01.000","state":1,"mgjzc":"0.553565","name":"厦工股份","pinyin":"sggf","totalcapital":"95896.9989","code":"600815","stockType":"A","currcapital":"95896.9989","profit_four":"-20.5594","market":"sh"},{"listing_date":"1997-02-28","ct":"2016-10-16 15:38:57.644","state":1,"mgjzc":"4.739511","name":"轻纺城","pinyin":"qfc","totalcapital":"104699.352","code":"600790","stockType":"A","currcapital":"104699.352","profit_four":"3.8654","market":"sh"},{"listing_date":"1996-07-01","ct":"2017-02-20 10:54:38.850","state":1,"mgjzc":"3.054795","name":"苏美达","status":"0","pinyin":"smd","totalcapital":"130674.9434","code":"600710","stockType":"A","currcapital":"64028.4","profit_four":"3.5810","market":"sh"},{"listing_date":"2016-06-07","ct":"2016-10-16 15:39:45.226","state":1,"mgjzc":"3.244037","name":"上海沪工","pinyin":"shhg","totalcapital":"20000","code":"603131","stockType":"A","currcapital":"5000","profit_four":"0.8083","market":"sh"},{"listing_date":"1997-03-18","ct":"2016-10-16 15:38:58.173","state":1,"mgjzc":"2.524806","name":"国电电力","pinyin":"gddl","totalcapital":"1965039.7845","code":"600795","stockType":"A","currcapital":"1965039.7845","profit_four":"23.1514","market":"sh"},{"listing_date":"2001-01-10","ct":"2016-10-16 15:38:07.479","state":1,"mgjzc":"4.824615","name":"江山股份","pinyin":"jsgf","totalcapital":"29700","code":"600389","stockType":"A","currcapital":"29700","profit_four":"1.3158","market":"sh"},{"listing_date":"2014-09-26","ct":"2016-10-16 15:39:47.634","state":1,"mgjzc":"8.644251","name":"华懋科技","pinyin":"hmkj","totalcapital":"23616.9004","code":"603306","stockType":"A","currcapital":"21273","profit_four":"2.6889","market":"sh"},{"listing_date":"2015-12-31","ct":"2016-10-16 15:39:56.851","state":1,"mgjzc":"1.923400","name":"乾景园林","pinyin":"qjyl","totalcapital":"50000","code":"603778","stockType":"A","currcapital":"22620.4093","profit_four":"0.6374","market":"sh"},{"listing_date":"2017-05-25","ct":"2017-05-26 04:11:55.247","state":1,"mgjzc":"5.540599","name":"艾艾精工","pinyin":"aajg","totalcapital":"6667","code":"603580","stockType":"A","currcapital":"1667","profit_four":"0.3408","market":"sh"},{"listing_date":"1992-03-27","ct":"2016-10-28 04:10:38.274","state":1,"mgjzc":"-0.110169","name":"ST沪科","pinyin":"sthk","totalcapital":"32886.1441","code":"600608","stockType":"A","currcapital":"31837.1441","profit_four":"-0.2542","market":"sh"},{"listing_date":"2000-11-06","ct":"2016-10-16 15:37:53.789","state":1,"mgjzc":"5.452506","name":"华仪电气","pinyin":"hydq","totalcapital":"75990.3511","code":"600290","stockType":"A","currcapital":"52688.3658","profit_four":"-0.4433","market":"sh"},{"listing_date":"2017-06-15","ct":"2017-06-16 04:17:36.290","state":1,"mgjzc":"7.754021","name":"吉华集团","pinyin":"jhjt","totalcapital":"50000","code":"603980","stockType":"A","currcapital":"10000","profit_four":"4.2371","market":"sh"},{"listing_date":"2017-09-26","ct":"2017-09-11 09:02:03.577","state":1,"mgjzc":"1.885913","name":"傲农生物","pinyin":"answ","totalcapital":"42609","code":"603363","stockType":"A","currcapital":"6000","profit_four":"0.0000","market":"sh"},{"listing_date":"2016-08-02","ct":"2016-10-16 15:39:12.360","state":1,"mgjzc":"7.692067","name":"江苏银行","pinyin":"jsyh","totalcapital":"1154445","code":"600919","stockType":"A","currcapital":"592397.7846","profit_four":"115.1666","market":"sh"},{"listing_date":"2018-05-09","ct":"2018-04-23 00:02:32.440","state":1,"mgjzc":"","name":"亚普股份","pinyin":"ypgf","code":"603013","totalcapital":"","currcapital":"","profit_four":"","market":"sh"},{"listing_date":"1997-07-09","ct":"2016-10-16 15:37:29.407","state":1,"mgjzc":"2.688270","name":"云天化","pinyin":"yth","totalcapital":"132137.9138","code":"600096","stockType":"A","currcapital":"112213.005","profit_four":"-18.6984","market":"sh"},{"listing_date":"2014-11-05","ct":"2016-10-16 15:39:18.841","state":1,"mgjzc":"4.302868","name":"陕西黑猫","pinyin":"sxhm","totalcapital":"125368.421","code":"601015","stockType":"A","currcapital":"93000","profit_four":"2.4763","market":"sh"},{"listing_date":"2014-12-31","ct":"2016-10-16 15:39:59.803","state":1,"mgjzc":"5.496696","name":"新澳股份","pinyin":"xagf","totalcapital":"39365.1068","code":"603889","stockType":"A","currcapital":"32305.8","profit_four":"1.7665","market":"sh"},{"listing_date":"2012-08-17","ct":"2016-10-16 15:39:38.996","state":1,"mgjzc":"9.406397","name":"龙宇燃油","pinyin":"lyry","totalcapital":"44111.4597","code":"603003","stockType":"A","currcapital":"44111.4597","profit_four":"0.7005","market":"sh"},{"listing_date":"1998-11-04","ct":"2016-11-04 04:10:16.478","state":1,"mgjzc":"2.823446","name":"安通控股","pinyin":"atkg","totalcapital":"106212.8511","code":"600179","stockType":"A","currcapital":"46582.8236","profit_four":"5.5237","market":"sh"},{"listing_date":"2017-03-10","ct":"2017-03-11 04:11:12.913","state":1,"mgjzc":"11.925737","name":"大千生态","status":"0","pinyin":"dqst","totalcapital":"8700","code":"603955","stockType":"A","currcapital":"5486.1702","profit_four":"0.8461","market":"sh"},{"listing_date":"2007-12-19","ct":"2017-02-20 10:54:40.272","state":1,"mgjzc":"1.883263","name":"新集能源","status":"0","pinyin":"xjny","totalcapital":"259054.18","code":"601918","stockType":"A","currcapital":"259054.18","profit_four":"1.6314","market":"sh"},{"listing_date":"2016-04-28","ct":"2016-10-16 15:39:58.321","state":1,"mgjzc":"8.840802","name":"嘉澳环保","pinyin":"jahb","totalcapital":"7335","code":"603822","stockType":"A","currcapital":"4060","profit_four":"0.4527","market":"sh"},{"listing_date":"1997-06-20","ct":"2016-10-16 15:37:27.939","state":1,"mgjzc":"2.523764","name":"海泰发展","pinyin":"htfz","totalcapital":"64611.5826","code":"600082","stockType":"A","currcapital":"63254.1802","profit_four":"-0.7690","market":"sh"},{"listing_date":"2000-06-22","ct":"2016-10-16 15:37:48.950","state":1,"mgjzc":"3.253743","name":"延长化建","pinyin":"ychj","totalcapital":"61579.596","code":"600248","stockType":"A","currcapital":"60760.596","profit_four":"1.2438","market":"sh"},{"listing_date":"2004-06-30","ct":"2016-10-16 15:39:15.193","state":1,"mgjzc":"3.691721","name":"汇鸿集团","pinyin":"hhjt","totalcapital":"224243.3192","code":"600981","stockType":"A","currcapital":"24185.4629","profit_four":"4.5233","market":"sh"},{"listing_date":"1993-10-28","ct":"2016-10-16 15:38:44.675","state":1,"mgjzc":"7.173594","name":"中船防务","pinyin":"zcfw","totalcapital":"141350.6378","code":"600685","stockType":"A","currcapital":"54933.5881","profit_four":"-1.2244","market":"sh"},{"listing_date":"2017-02-08","ct":"2017-02-21 04:10:24.891","state":1,"mgjzc":"5.330040","name":"镇海股份","status":"0","pinyin":"zhgf","totalcapital":"13299.6616","code":"603637","stockType":"A","currcapital":"3324.919","profit_four":"0.4627","market":"sh"},{"listing_date":"1998-05-20","ct":"2016-10-16 15:37:35.857","state":-1,"mgjzc":"2.798293","name":"长春一东","pinyin":"ccyd","totalcapital":"14151.645","code":"600148","stockType":"A","currcapital":"14151.645","profit_four":"0.2031","market":"sh"}],"ret_code":0,"maxResult":50,"allPages":30,"currentPage":1}}

中文会编程?号

akof1314 commented 6 years ago

image 我这边并不会,你语言是选JSON吗

zjt613 commented 6 years ago

嗯嗯 不过我的语言包是英文的 可能是 这个问题把

zjt613 commented 6 years ago

2018-05-23_122040

malinru commented 6 years ago

是不是剪切板的问题,当前输入法是中文,复制粘贴,不会乱码。 如果文档是中文,当前输入法是英文,复制,粘贴时就会乱码。

zjt613 commented 6 years ago

嗯嗯,有可能

jamescvbn commented 6 years ago

+1. 我也遇到了这个问题。

测试代码

{
   "id" : 1,
   "name" : "测试"
}

格式化结果

image

似乎当系统显示语言非中文时会发生这个bug。

image

请作者再调查下。

imkos commented 5 years ago

此问题,作者会修复吗,系统显示语言非中文下 会出现这个问题