Created
January 4, 2017 08:44
-
-
Save Kikobeats/e852c8ecae43a22f8194f6610cff5d98 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var utf8 = require('utf8'); | |
var val1 = utf8.decode('\xE2\x80\x99'); | |
const StringDecoder = require('string_decoder').StringDecoder; | |
const decoder = new StringDecoder('utf8'); | |
const symbol = new Buffer([0xE2, 0x80, 0x99]); | |
const val2 = decoder.write(symbol); | |
console.log(val1); | |
console.log(val2); | |
console.log(val1 === val2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment