Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update iconv-lite

0.2.7 doesn't support cp932. 0.4.2 does.
  • Loading branch information...
commit aa6aaa1510a5e84d856b73fc73d6f09b46e40c6e 1 parent 84d7b00
@cgc cgc authored
Showing with 5 additions and 3 deletions.
  1. +1 −1  package.json
  2. +4 −2 src/value-parser.coffee
View
2  package.json
@@ -36,7 +36,7 @@
"node": "0.6 || 0.7 || 0.8 || 0.9 || 0.10 || 0.11"
},
"dependencies": {
- "iconv-lite": "0.2.7",
+ "iconv-lite": "0.4.2",
"sprintf": "0.1.1"
},
"devDependencies": {
View
6 src/value-parser.coffee
@@ -11,6 +11,8 @@ MONEY_DIVISOR = 10000
PLP_NULL = new Buffer([0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF])
UNKNOWN_PLP_LEN = new Buffer([0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF])
+DEFAULT_ENCODING = 'utf8'
+
parse = (buffer, metaData, options) ->
value = undefined
dataLength = undefined
@@ -220,7 +222,7 @@ readBinary = (buffer, dataLength) ->
else
buffer.readBuffer(dataLength)
-readChars = (buffer, dataLength, codepage) ->
+readChars = (buffer, dataLength, codepage=DEFAULT_ENCODING) ->
if dataLength == NULL
null
else
@@ -237,7 +239,7 @@ readMaxBinary = (buffer) ->
valueBuffer
)
-readMaxChars = (buffer, codepage) ->
+readMaxChars = (buffer, codepage=DEFAULT_ENCODING) ->
readMax(buffer, (valueBuffer) ->
iconv.decode(valueBuffer, codepage)
)
Please sign in to comment.
Something went wrong with that request. Please try again.