snippets with unicode characters
Asked by
Jakub Mikołajczyk
I'm trying to write my own snippets using python. I copied this code from help and modified one line:
global !p
def upper_right(inp):
return (75 - 2 * len(inp))*' ' + inp.replace(u"ł", u"x")
endglobal
snippet wow
${1:Text}`!p snip.rv = upper_right(t[1])`
endsnippet
I want to replace inputted unicode character 'ł' (\u0142) with 'x'. But the replacement won't happen. It won't work with any other non-ascii character however when I use regular ascii character it works flawlessly.
First I thought it may be a python problem but that code works also in python shell. Am I doing something wrong?
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- UltiSnips Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- SirVer
- Solved:
- Last query:
- Last reply:
To post a message you must log in.