-
Notifications
You must be signed in to change notification settings - Fork 127
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
如何解决中文名称的乱码问题 #109
Comments
The only solution: use English, that's all! Using Chinese in the wrong place will make you lower yourself. |
const compressing = require('compressing'); const result = await compressing.zip.uncompress(file, unpackDir, { |
Where is the correct place for using Chinese? |
use JSZip to load data and write data into file system. |
LOL so why don't you answer him in Chinese but in English? Don't you find yourself ridiculous? My answer was in your comment. |
I'm worried about your brain cannot handle Chinese. Pity you and help you understand. |
Be superior in your own Chinese home, please! Nobody cares about your language, so you don't have to show others that you're a clown. Why do I need to handle Chinese? To be a clown like you? LMAO |
抄个代码还受到了歧视,我也换一个好啦 |
它又不是开发者,就一没脑子的傻卵罢了 |
so you can do something like below const extract = require("extract-zip");
const iconv = require('iconv-lite')
const cp437 = '\u0000☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ '
function decodeCp437(str) {
const buffArr = []
for (const s of str) {
buffArr.push(cp437.indexOf(s))
}
return Buffer.from(buffArr)
}
extract(
'special encoding file name.zip',
{
dir: 'your unzip dir',
onEntry: function (entry) {
// decode
entry.fileName = iconv.decode(decodeCp437(entry.fileName), 'special encoding')
}
}
)
.then(() => { }) the solution is not so good because it did something opposite to |
what "special encoding" should i set, tried 'GBK' is not working. @KirrsGool |
ZIP format do not contain the encoding information of the file names, you need determine it by yourself or detect it (for Simplified Chinese it may be ZIP 格式没有包含文件名的编码信息, 你需要自行决定或者探测解压时使用的编码, 简体中文一般是 |
No description provided.
The text was updated successfully, but these errors were encountered: