colinta / SublimeStringEncode

Converts characters from one "encoding" to another using a transformation (think HTML entities, not character encodings)
Other
150 stars 22 forks source link

allow users to decode unicode escaped texts #41

Closed aosaimy closed 4 years ago

aosaimy commented 4 years ago

Decoding strings like \uXXXX to normal Unicode text. See this question: SO questopm

colinta commented 4 years ago

This looks great, though I would expect the command to actually be UnicodeUnescapeCommand - "escaping" unicode should convert the unicode symbols to \xxxx and unescaping should convert them back into text. What do you think of this change?

colinta commented 4 years ago

I tested this using the text \u0e4f\u032f\u0361\u0e4f and it had no effect. What is the expected behavior or test case for this plugin?

colinta commented 4 years ago

Oh, I see, it turns unicode characters into their escaped version – this is unfortunately a language-specific syntax (right now it's outputting in Python), but better than nothing.

It's very similar to this package: https://packagecontrol.io/packages/Unicode%20Escape

In the future it would be nice to detect the language and output the appropriate string, but like I said I think this works. Thanks!

colinta commented 4 years ago

Available in 2.4.0