作者CodingMan ()
看板Ajax
標題[問題] 使用 Websocket 連線 PTT 如何使用 utf-8
時間Mon Sep 3 11:15:57 2018
如標題
目前使用以下程式碼對 PTT 連線
options = {}
options.origin = '
https://webptt.com/m.aspx?n='
this.ws = new WebSocket('wss://ws.ptt.cc/bbsu/', options)
可是回傳回來一堆亂碼,
參考了前人的程式碼發現是需要將 big5uao 轉換回 utf-8
請問有辦法像 ssh
[email protected] 類似的方法
讓 PTT 自己回傳 utf-8 字串嗎?
先謝謝各位了
--
https://i.imgur.com/B1kIMgR.png
寫你的 PTT 機器人
https://github.com/Truth0906/PTTLibrary
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 59.124.167.226
※ 文章網址: https://webptt.com/m.aspx?n=bbs/Ajax/M.1535944563.A.440.html
1F:推 eight0: 這應該問 PTT,或是 PttChrome 的作者 09/03 13:15
2F:→ CodingMan: 好的 我看一下 感恩 09/03 13:44
3F:推 VdustR: 登入的時候帳號加 , 09/17 14:57