Open fabienjuif opened 6 years ago
And this is the example I used to test the conversion matrix:
const run = async () => {
const raw = await readFile('./cp1147.txt')
const toArray = Array.from(raw)
return toArray.map((char) => {
const unicodeChar = matrice[char.toString(16)]
if (unicodeChar === undefined) return '?'
return unicodeChar
})
}
run()
.then(codes => {
console.log(codes.join(''))
})
related to #111
Hi, Mechanism to add encodings from external npm packages #253 , I hope it helps.
Hi @ashtuchkin
I wanted to add the cp1147 parsing in your lib. How can I do that?
I know the codepage layout from here: https://en.wikipedia.org/wiki/EBCDIC_297 I wrote this simple function on top of this wikipedia page:
Which produce this (I have commented special character for now, but I will map them manually after):
I saw on this PR that an chars array can be used: https://github.com/ashtuchkin/iconv-lite/pull/196/files#diff-6072bbae0aa1a9b4406cc0e3b969095fR22
Should I use this? How do I know what is the first character mapping?
Thank you 👍
PS: feel free to RTFM me! With links please ;)