Closed GoogleCodeExporter closed 9 years ago
There also appears to be no support for python tuples.
IMO should be converted to Arrays, asymmetric, yes, but that's what you get
when converting between different type systems.
Original comment by alex.na...@gmail.com
on 28 Aug 2012 at 12:20
Unicode need to be converted to bytes using string.encode, so the code to work
would need to be changed to:
def loadJSON(path):
with open(path) as f:
return json.load(f).encode('utf-8')
There was an another similar issue here:
http://code.google.com/p/cefpython/issues/detail?id=5&can=1
The question is whether we should do the conversion automatically? Call
.encode('utf-8') on all unicode strings?
Original comment by czarek.t...@gmail.com
on 28 Aug 2012 at 1:34
Python tuples - yes we can convert it to array.
Are there any other types that come to your mind that we should support as well?
Original comment by czarek.t...@gmail.com
on 28 Aug 2012 at 1:35
The browser handles encodings on a per-file or pre-request basis, so I see no
reason to deviate from this.
As JS has no separate types for bytes/unicode/strings it would seem logical to
convert everything to String, the question is what should we use for
encoding...
I'd go for POLS here too, and that would be to encode automatically and use
browser/CEF setting of encoding for that (defaulting to utf-8).
As to the list of types, the short answer would be "everything" simplejson/json
libs support, but if you want I could compile a full list a bit later.
I'll do a more complete test on this within this week, we are planing a
pre-alpha release within the first half of September, and at this point
CEFPython is the primary target for Windows (would be nice if it would be the
same for U*IX and MacOSX, but that's another issue)
Original comment by alex.na...@gmail.com
on 28 Aug 2012 at 2:26
Should this encoding setting be per browser or per application setting? We
already have [ApplicationSettings] and [BrowserSettings]. Or maybe should we
create a separate dictionary for cefpython specific settings so we don't mix it
with what is already in CEF? To think.
If you could compile a full list that would be great. Currently we support:
* list
* bool
* double
* int
* None (null in js)
* dict (object in js)
* string
* function (python callback)
* instancemethod (python callback, an object's method)
Original comment by czarek.t...@gmail.com
on 28 Aug 2012 at 2:32
[ApplicationSettings] has a new option: `unicode_to_bytes_encoding`.
'''What kind of encoding should we use when converting unicode string to bytes
string? This conversion is done when you pass a unicode string to javascript.
The default is "utf-8".'''
Original comment by czarek.t...@gmail.com
on 28 Aug 2012 at 5:35
Original comment by czarek.t...@gmail.com
on 28 Aug 2012 at 5:36
Unicode string and Tuple can now be passed to javascript.
This fix will make it into next release.
If tou think there are more types that should be converted, post them here and
I will re-open this issue.
Original comment by czarek.t...@gmail.com
on 28 Aug 2012 at 7:51
Version 0.36 released, includes fix for this issue.
Original comment by czarek.t...@gmail.com
on 29 Aug 2012 at 5:53
Project will move to Github. Find this issue at the new address (soon):
https://github.com/cztomczak/cefpython/issues/10
Original comment by czarek.t...@gmail.com
on 24 Aug 2015 at 6:24
Original issue reported on code.google.com by
alex.na...@gmail.com
on 28 Aug 2012 at 12:04