u() function does not support unicode character escapes

Issue #2 resolved
Matt Chaput
created an issue

If I do:

{{{ six.u("\u1234") }}}

in Python 2.x I should get:

{{{ u'\u1234' }}}

but instead I get:

{{{ u'\uABCD' }}}

Unfortunately the only way I can think of to fix this is to loop through the unicode string with a regular expression and rebuild the string to replace {{{\u([0-9a-fA-F]{4})}}} with {{{unichr(int(match.group(1), 16))}}} if you see what I mean.

Comments (3)

  1. Log in to comment