gpt4 book ai didi

http - 如何使用 node.js 猜测 http 编码?

转载 作者:可可西里 更新时间:2023-11-01 17:13:27 26 4
gpt4 key购买 nike

当我收到此页面时 http://booking.airasia.com/css/AKBase/Cultures/en-GB/far-min.css与 Node 的 http , toString方法给了我腐败的东西。显然该页面在 UTF-16 中, 但标题中没有提及这一事实。然而,Firefox 猜测编码没有问题,这是 Node 可以做的吗?

(我知道我可以转换这个特定的页面,因为我现在知道它的编码,但我想猜测编码)

最佳答案

我的一位前同事将 python chardet 移植到 javascript:https://github.com/aadsm/jschardet

关于http - 如何使用 node.js 猜测 http 编码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8851289/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com