---
title: "APP微信支付 服务端开发body不是utf-8编码终极解决"
author: "corelengine"
date: "2016-06-28T22:57:00Z"
tags: []
categories: ["移动开发"]
slug: "app-body-utf-8"
draft: false
lastmod: "2016-06-28T23:01:22Z"
id: 2307877
url: "https://corelengine.iteye.com/blog/2307877"
---

这个变态问题，加上二次签名，浪费了至少三天时间，body需要转码，如果转码utf-8乱码一定要看,编辑器本身的编码是否是utf-8。
		ordername=ordername.replace(" ", "");//注意标题一定去空格
		try {
			ordername   = new String(ordername.getBytes("utf-8"));
			
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}  



感谢大家分享http://www.oschina.net/question/573966_237517?sort=time&p=2#answers