Sublime Forum

ST2 - Getting Unicode Wide characters from View

#1

Hi All,

I have a plugin that currently works with the text from a view, I retrieve all the text doing this:
view.substr(sublime.Region(0, view.size()))

Now, in my view I have the character unicode U+1F4A6 (I can’t paste the character or I won’t be able to post the question to the forum…), and when I do that I get back u’\uf4a6’ instead of u’\U0001f4a6’ which is what I expect and get in ST3.

I understand that the python version ST2 uses has been compiled without support for SMP and other unicode planes besides the basic plane, but is there a work around for this behavior? Something else I can do? Or am I messing up something since my python-fu is not so strong?

For information I’m comparing ST2 2.0.2 B2221 on OSX to ST3 B3083.

Thanks!

0 Likes