A
A
Alexey Dugnist2015-12-25 17:56:48
Node.js
Alexey Dugnist, 2015-12-25 17:56:48

How to properly convert zip file to text in node?

The bottom line is this: when I open a zip archive in sublime, I get a certain set of characters like:
504b 0304 1400 0800 0800 4472 9947 0000
When I open the same file in node:

fs.readFile dicname, "utf8", ( err, data )->
  console.log data

I naturally throw out porridge, like �F�n��0�v�w�Q�������a���h7�wE���.
So how can I get the result through the node as above...?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Avilov, 2015-12-25
@Peekab0o

data.toString('hex')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question