TooTallNate / file-uri-to-path

Convert a `file:` URI to a file path
MIT License
27 stars 8 forks source link

Wrongly decoding URL encoded multibyte UTF8 characters #5

Closed olydis closed 7 years ago

olydis commented 7 years ago

Passing in file:///C:/P%C3%A9ter/test.txt returns C:\\Péter\\test.txt instead of C:\\Péter\\test.txt (note that %C3%A9 is the correct representation of é).

The fix should be trivial: In this line you use the deprecated unescape function instead of decodeURI (which correctly handles the above case).

BTW, awesome package (together with get-uri)! It's super light-weight helper packages like these that make developing for node so much fun 😄