Problems with unicode support for strings from imported packages

Asked by radioxid

Hi,
I try to paste strings from my personal packages into Spotlight (obv. on Mac) but only get empty strings.

What I do:
=======
import sys
sys.path.append('/Users/spud/workspace/sik/')
import tests # works
T = tests.Tests.string

print T # Nothing
type(" ", KEY_CMD) # Spotlight
paste(T) # Nothing again
type(T) # Nothing again again

What it does:
========
Well, it opens Spotlight

What works:
========
print '@', 'm', "éèà"
type('éàç')

Notes:
====
 • My keyboard is AZERTY
 • T is of str() type, composed of ASCII chars encoded in UTF-8 (so… ASCII)
 • My cat has no name

Thought:
======
 • Why is it ≠ to print str from the very Sikuli's file and mines?
 • Don't mind the cat

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
radioxid
Solved:
Last query:
Last reply:
Revision history for this message
radioxid (zmindster) said :
#1

Wait. I tried relaunching the IDE and it seems to reload my package.
I thought every time I Ran the script it'd have done it too. So the IDE's Jython engine works in the same way as python-cli…

I'm digging on that. Wouldn't take much time before I figure the thing out. thxbye

Revision history for this message
radioxid (zmindster) said :
#2

The problem came from this string:

string = u"zgzg à zgzegze"

Some way or another it didn't like that 'u"' was combined with 'à'.

What solved it:
=========
Remove the 'u' beginning string that contains exotic chars… (this conclusion is so weird)