課程
/后端開發
/PHP
/實例學習 PHP QRCode生成二維碼
為啥漢字生成,是亂碼!如何解決啊老師??
2017-07-19
源自:實例學習 PHP QRCode生成二維碼 6-3
正在回答
<script?type="text/javascript"> function?utf16to8(str)?{?? ????var?out,?i,?len,?c;?? ????out?=?"";?? ????len?=?str.length;?? ????for(i?=?0;?i?<?len;?i++)?{?? ????c?=?str.charCodeAt(i);?? ????if?((c?>=?0x0001)?&&?(c?<=?0x007F))?{?? ????????out?+=?str.charAt(i);?? ????}?else?if?(c?>?0x07FF)?{?? ????????out?+=?String.fromCharCode(0xE0?|?((c?>>?12)?&?0x0F));?? ????????out?+=?String.fromCharCode(0x80?|?((c?>>??6)?&?0x3F));?? ????????out?+=?String.fromCharCode(0x80?|?((c?>>??0)?&?0x3F));?? ????}?else?{?? ????????out?+=?String.fromCharCode(0xC0?|?((c?>>??6)?&?0x1F));?? ????????out?+=?String.fromCharCode(0x80?|?((c?>>??0)?&?0x3F));?? ????}?? ????}?? ????return?out;?? }?? </script> <script?type="text/javascript"> $('#qrcode').qrcode(utf16to8("??this?is?test?慕課網?")); $('#qrcode').qrcode({width:?64,height:?64,text:utf16to8('this?is?test?慕課網')?}); </script>
你看下你瀏覽器里面的代碼格式設置和編輯器里面的代碼格式設置是一樣的嗎?如果不一樣,輸出會產生亂碼的!
舉報
本門課程主要講解如何使用 PHP 生成識別二維碼!
2 回答jquery生成二維碼.jpg文件
1 回答PHP生成的二維碼怎么修改保存路徑呢?
1 回答gif二維碼
1 回答動態二維碼設計
1 回答其他圖形的二維碼
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2018-01-27
2017-07-21
你看下你瀏覽器里面的代碼格式設置和編輯器里面的代碼格式設置是一樣的嗎?如果不一樣,輸出會產生亂碼的!