Commit 301ffcc5 authored by imgqb's avatar imgqb

chinese character

parent c2018418
{jspack} = require 'jspack' {jspack} = require 'jspack'
Util = require './util.coffee' Util = require './util.coffee'
iconv = require 'iconv-lite'
module.exports = class File module.exports = class File
FORMATS = FORMATS =
...@@ -41,8 +42,8 @@ module.exports = class File ...@@ -41,8 +42,8 @@ module.exports = class File
readString: (length) -> String.fromCharCode.apply(null, @read(length)).replace /\u0000/g, "" readString: (length) -> String.fromCharCode.apply(null, @read(length)).replace /\u0000/g, ""
readUnicodeString: (length = null) -> readUnicodeString: (length = null) ->
length or= @readInt() length or= @readInt()
# new Buffer(@read(length * 2)) iconv.decode(new Buffer(@read(length * 2)),'utf-16be')
@read(length * 2) # @read(length * 2)
# .map((c) -> Util.getUnicodeCharacter(c)) # .map((c) -> Util.getUnicodeCharacter(c))
# .join('') # .join('')
# .replace(/\u0000/g, '') # .replace(/\u0000/g, '')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment