微信创建菜单报 must use utf-8 charset hint 错误
发布时间:2020-12-14 02:45:00 所属栏目:Windows 来源:网络整理
导读:? php include ‘../WeiXinApi/WeiXinApi.php‘ ; // 创建菜单. $access_token = getToken(); if ( $access_token ==‘-1‘ ) { echo ("get token failed" ); exit (); } $getCreatMenuUrl =‘https://api.weixin.qq.com/cgi-bin/menu/create?access_token=
<?php include ‘../WeiXinApi/WeiXinApi.php‘; //创建菜单. $access_token= getToken(); if ($access_token ==‘-1‘) { echo ("get token failed"); exit(); } $getCreatMenuUrl=‘https://api.weixin.qq.com/cgi-bin/menu/create?access_token=‘.$access_token; $jsonStr= ‘{"button":[{"type":"click","name":"今日歌曲","key":"V1001_TODAY_MUSIC"},{"name":"菜单","sub_button":[{"type":"view","name":"搜索","url":"http://www.soso.com/"},{"type":"click","name":"赞一下我们","key":"V1001_GOOD"}]}]}‘; //$jsonStr=json_encode($jsonStr,JSON_UNESCAPED_UNICODE); $responsJson=http_post_json($getCreatMenuUrl,$jsonStr); echo ($responsJson[0] . $responsJson[1]); ?> 这是因为本身windows平台文件是不是默认utf-8格式的,另存为把文件改成utf-8格式.. 运行正确. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 适用于Windows的良好系统日志服务器
- 如何使Windows XP VMWare映像可以看到本地驱动器?
- windows-server-2003 – GetFileSize方法在146170227字节的
- Window应急响应(五):ARP病毒
- windows-server-2008 – 如果我手动设置Response.StatusCod
- Emacs for Windows错误加载颜色主题
- windows – 无法从NFS共享启动MSI安装程序
- windows – 在gui中包装rsync进度的最佳方法?
- windows-phone-7 – 提示文本的密码框
- 将Selenium Server和ChromeDriver作为Windows服务运行
推荐文章
站长推荐
- windows – 是否有像PeekMessage这样的函数不处理
- 硒 – 与桌面屏幕分辨率交互的Windows服务
- winforms – 在F#中使用Windows窗体的面向对象的
- windows-server-2008 – 从Windows Server 2008中
- windows-server-2012 – Hyper-V动态内存无法正确
- Windows Server如何与Windows桌面进行不同的优化
- Qt可用于开发Windows IoT核心应用程序吗?
- windows-server-2008 – 如果我不小心重置了计算
- windows-phone – 如何让Windows Phone应用程序在
- office365 – Microsoft Graph:在一个请求中列出
热点阅读