Code Monkey home page Code Monkey logo

utf7's People

Contributors

kkaefer avatar metamatt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

utf7's Issues

Problem in node v8.1.3 - allocateBase64Buffer is not defined

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?

decode error for some chinese words

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 ?

utf7 does not work in node verson >=6.0.0

$ 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

Reworked UTF7

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

https://github.com/emailjs/emailjs-utf7

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.