Skip to content

Commit

Permalink
test of iconv
Browse files Browse the repository at this point in the history
  • Loading branch information
jmav committed May 30, 2013
1 parent d95f8e8 commit 5e85caa
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions poc-iconv.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Iconv = require('iconv').Iconv;
// var iconv = new Iconv('UTF-8', 'ISO-8859-1');
// var latinBuf = iconv.convert('čćžđš');
// console.log(latinBuf);

// convert from UTF-8 to ISO-8859-1
// var Buffer = require('buffer').Buffer;
var Iconv = require('iconv').Iconv;

var iconv = new Iconv('UTF-8', 'cp1250');
var aa = 'Hello, world!';
var buffer = iconv.convert(aa);
// var buffer2 = iconv.convert(new Buffer('Hello, world!'));
console.log(buffer, Buffer.byteLength(aa)/1024, 'Kb');
// assert.equals(buffer.inspect(), buffer2.inspect());
// do something useful with the buffers

0 comments on commit 5e85caa

Please sign in to comment.