You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I compiled PyV8 under freebsd, and got following error:
with JSContext() as c:
c.locals.s = u"测试"
print len(c.locals.s) # this will print 1, instead of 2
c.locals.s = u"1234"
print len(c.locals.s) # this will print 1, instead of 4
In fact assign an unicode to JSContext will always return its length as 1.
After dig into the code, I found this is caused because on my FreeBSD the
python unicode is defined as UCS4 - the wide unicode (on win32, it will be
UCS2) this caused a problem when converting python unicode to v8::String in
CPythonObject::Wrap() method.
I patched the method to check if python is using UCS4 or UCS2 to determine
how to convert python unicode to v8::String.
Attached is the patched Wrapper.cpp, line 458-470 is modified.
Original issue reported on code.google.com by nuphahu...@gmail.com on 30 Sep 2009 at 5:18
Original issue reported on code.google.com by
nuphahu...@gmail.com
on 30 Sep 2009 at 5:18Attachments:
The text was updated successfully, but these errors were encountered: