微信公众号自定义菜单
官方文档   https://developers.weixin.qq.com/doc/offiaccount/custom_menus/creating_custom-defined_menu.html
 
很简单的一个接口调用,但是当有中文菜单名的名的就可能出下面2个错误
 
{“errcode”:40016,”errmsg”:”invalid button size”} 
{“errcode”:40033,”errmsg”:”invalid charset. please check your request, if include \uxxxx will create fail!”}
 
原因是php的json_encode函数将中文转为了 unicode 格式,但是微信要求不能有\uxxx格式的字符,所以会报错
 
解决办法,php 5.4之后json_encode新增了一个参数json_unescaped_unicode,不转中文为unicode