pieroxy / lz-string

LZ-based compression algorithm for JavaScript
MIT License
4.12k stars 568 forks source link

Feature request: compress to source-compatible character set #180

Open emlyn opened 1 year ago

emlyn commented 1 year ago

It would be nice to have a mode that can be dumped as a string in a javascript source file (I think UTF16 without special characters below 0x20 and without single or double quotes... I'm not sure if there are other characters that could be problematic).

Rycochet commented 8 months ago

Technically you need to be wary of utf-8 / utf16 as some editors don't support it properly and it can lose data, but this is another one that works well with compressToCustom - with the correct dictionary - I have a feeling there'll be several dictionaries for different uses added to the code over the coming months 🙂