markushedvall / plantuml-encoder

PlantUML encoder, works in browser & node.js
MIT License
106 stars 15 forks source link

unescape is not support UTF-8? #4

Closed tsuyoshicho closed 7 years ago

tsuyoshicho commented 8 years ago

see https://github.com/GitbookIO/plugin-puml/issues/1

Was and continues to research, the problem is thought that there may be here.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/unescape https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Deprecated_and_obsolete_features

unescape is UTF-8 do not work correctly?

MienDev commented 8 years ago

@tsuyoshicho , I ran into this too. any workround? (thanks in advance.)

markushedvall commented 7 years ago

Thank you for reporting this and sorry for my delay to come back to you.

The issue has been resolved in the 1.2.4 release. The problem was not really with unescape itself but an error on my part. The unescape sequence encoded a string in utf-8 format into an utf-16 string. This is not what the deflate function expected.

Either way, I've removed the use of unescape and now encodes into an utf-8 byte array which works well as input to the deflate function.

Please inform me if you still experience any problems.

tsuyoshicho commented 7 years ago

Thanks, I try it.