-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
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 |