Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openqq, urlencode, 无效, 中文乱码 #271

Open
yssource opened this issue Nov 16, 2018 · 7 comments
Open

openqq, urlencode, 无效, 中文乱码 #271

yssource opened this issue Nov 16, 2018 · 7 comments
Labels

Comments

@yssource
Copy link

curl http://127.0.0.1:5000/openqq/send_group_message\?id\=123456\&content\=大家好\&async\=1

curl http://127.0.0.1:5000/openqq/send_group_message\?id\=123456\&content\=hello%0A%E4%BD%A0%E5%A5%BD+%E5%8F%AF%E6%84%9B%E3%81%84%0Ahello2%0Ahello3\&async\=1

两个结果都是一样, 在 QQ 手机端, 显示的乱码。

@yssource yssource changed the title urlencode, 无效, 中文乱码 openqq, urlencode, 无效, 中文乱码 Nov 16, 2018
@hexsum
Copy link
Owner

hexsum commented Nov 22, 2018

url本身加引号,不要有反斜杠

curl "http://127.0.0.1:5000/openqq/send_group_message?id=123456&content=hello%0A%E4%BD%A0%E5%A5%BD+%E5%8F%AF%E6%84%9B%E3%81%84%0Ahello2%0Ahello3&async=1"

@hexsum hexsum closed this as completed Nov 22, 2018
@yssource
Copy link
Author

url本身加引号,不要有反斜杠

  • curl 测试,手机端中文依旧是乱码

  • 用以下python代码测试, 手机端也是同样乱码,terminal log 是正常的中文

# -*- coding: utf-8 -*-
import requests
id_ = 538***593 # *** 表示隐藏
content = "你好"
data = {"id": id_, "content": content, 'async': 1}
api = 'http://127.0.0.1:5000/openqq/send_group_message'
r = requests.post(api, data)
print(r.text)

@hexsum
Copy link
Owner

hexsum commented Nov 26, 2018

python的代码亲自跑了一下,我这里也没有乱码……

@hexsum hexsum reopened this Nov 26, 2018
@hexsum hexsum added the bug label Nov 26, 2018
@yssource
Copy link
Author

我这里

  • Mojo-Weixin 不会出现乱码
  • Mojo-Webqq 手机端出现乱码, 接受别人的不会有乱码, 自己发出去的是乱码。
 -- Non-blocking request (http://d1.web2.qq.com/channel/poll2)
  -- Client >>> Server (http://d1.web2.qq.com/channel/poll2)
  POST /channel/poll2 HTTP/1.1
  Cookie: p_uin=o1034539004; pt4_token=fJb3mlmwEUK8vgCAxok6WfktkadeIfbyd-SyccEpgvs_; p_skey=RYQZaA4MGBT8zb8Kd56jV2IoDK3xn0qr89qWgxphAus_; RK=iTDtfAdgO+; ptisp=cnc; ptcz=a6cf5b0195d5ac676ce7d74d3a585ef27f1462cf3e54f2ffa7f837060b7d377b; uin=o1034539004; skey=@96b9A9NTC; pt2gguin=o1034539004
  Accept-Encoding: gzip
  User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062
  Referer: http://d1.web2.qq.com/proxy.html?v=20151105001&callback=1&id=2
  Content-Length: 329
  Host: d1.web2.qq.com
  Content-Type: application/x-www-form-urlencoded
  
  r=%7B%22clientid%22%3A53999199%2C%22key%22%3A%22%22%2C%22psessionid%22%3A%228368046764001d636f6e6e7365727665725f77656271714031302e3133332e34312e383400001ad00000066b026e040015808a206d0000000a406172314338344a69526d0000002859185d94e66218548d1ecb1a12513c86126b3afb97a3c2955b1070324790733ddb059ab166de6857%22%2C%22ptwebqq%22%3Anull%7D
  -- Server >>> Client (http://d1.web2.qq.com/channel/poll2)
  HTTP/1.1 200 OK
  Connection: keep-alive
  Content-Length: 314
  Content-Type: application/json; charset=utf-8
  Date: Mon, 26 Nov 2018 13:56:23 GMT
  
  {"result":[{"poll_type":"group_message","value":{"content":[["font",{"color":"000000","name":"微软雅黑","size":10,"style":[0,0,0]}],"你好"],"from_uin":538418593,"group_code":538418593,"msg_id":11719,"msg_type":4,"send_uin":1034539004,"time":1543240584,"to_uin":1034539004}}],"retcode":0,"retmsg":"ok"}

  • 我对perl不是很熟悉,暂时没有能力debug, 追踪问题所在。我把上面的log打印出来。注意 "你好" 乱码对应的是 "你好"

@yssource
Copy link
Author

yssource commented Nov 26, 2018

现在不仅仅是 openqq 发消息中文乱码, 更新到 v2.2.6 后, IRCShell 也是中文乱码。
发消息乱码, 接受消息正常。

@hexsum
Copy link
Owner

hexsum commented Nov 27, 2018

你输入法或者输入终端使用的确定是utf8编码?

@yssource
Copy link
Author

yssource commented Nov 27, 2018

            LANG=en_US.UTF-8
            LC_CTYPE=zh_CN.UTF-8 # 这里配置了中文环境 `LC_CTYPE=zh_CN.UTF-8`
            LC_NUMERIC="en_US.UTF-8"
            LC_TIME="en_US.UTF-8"
            LC_COLLATE="en_US.UTF-8"
            LC_MONETARY="en_US.UTF-8"
            LC_MESSAGES="en_US.UTF-8"
            LC_PAPER="en_US.UTF-8"
            LC_NAME="en_US.UTF-8"
            LC_ADDRESS="en_US.UTF-8"
            LC_TELEPHONE="en_US.UTF-8"
            LC_MEASUREMENT="en_US.UTF-8"
            LC_IDENTIFICATION="en_US.UTF-8"
            LC_ALL=
  • Mojo-Weixin 正常接发收

  • Mojo-Webqq

    • ShowMsg
      • terminal 打印出来的 info 是正常显示的。
    • openqq, IRCShell
      • terminal 打印出来的 info 是正常显示的。
      • 收到他人的信息也是正常的。
      • 发出去的消息,手机端乱码 
  • 抽时间,我学一下 perl, 争取自己排解问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants