kkaefer / utf7 Goto Github PK
View Code? Open in Web Editor NEWConverts text to and from UTF-7 (RFC 2152 and IMAP).
License: MIT License
Converts text to and from UTF-7 (RFC 2152 and IMAP).
License: MIT License
node_modules\utf7\utf7.js:41:13)
Get this problem when caling imap.decode("F&APY-reslagna kontakter")
The workaround I have done is changeing rows 4-12 to
// if (semver.gte(semver.clean(process.version), '6.0.0')) { function allocateAsciiBuffer(length) { return Buffer.alloc(length, 'ascii'); } // } else { // function allocateAsciiBuffer(length) { // return new Buffer(length, 'ascii'); // } // }
and lines 30-38 to
//if (semver.gte(semver.clean(process.version), '6.0.0')) { function allocateBase64Buffer(str) { return Buffer.from(str, 'base64'); } // } else { // function allocateBase64Buffer(str) { // return new Buffer(str, 'base64'); // } // }
Do you have a better solution so I can continue using your npm-package?
Try this:
var utf7 = require('utf7')
var msg = '新建'
console.log(msg, utf7.encode(msg), utf7.decode(utf7.encode(msg)))
Output:
新建 +ZbBe+g- 新帀
If I change the msg to a single word 建
, encode & decode is correct. When it msg contains 2 words it got wrong decode.
Any idea ?
$ node
var u=require('utf7').imap;
undefined
u.encode('你好')
Error: If encoding is specified then the first argument must be a string
at new Buffer (buffer.js:106:13)
at encode (/usr/local/lib/node_modules/appium/node_modules/appium-selendroid-driver/node_modules/utf7/utf7.js:4:13)
at /usr/local/lib/node_modules/appium/node_modules/appium-selendroid-driver/node_modules/utf7/utf7.js:77:39
at RegExp.Symbol.replace
at String.replace (native)
at Object.exports.imap.encode (/usr/local/lib/node_modules/appium/node_modules/appium-selendroid-driver/node_modules/utf7/utf7.js:75:36)
at repl:1:3
at REPLServer.defaultEval (repl.js:272:27)
at bound (domain.js:280:14)
at REPLServer.runBound as eval
Hi there,
a longish time ago, my team and me forked your UTF7 lib.
In the meantime, I reworked it quite a bit for runtime independence, ES6, JSDOC, StandardJS style, etc.. Are you interested in joining the projects again?
Cheers
Felix
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.