Comments (9)
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 [email protected]
on 28 Aug 2012 at 12:20
from cefpython.
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 [email protected]
on 28 Aug 2012 at 1:34
from cefpython.
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 [email protected]
on 28 Aug 2012 at 1:35
from cefpython.
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 [email protected]
on 28 Aug 2012 at 2:26
from cefpython.
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 [email protected]
on 28 Aug 2012 at 2:32
from cefpython.
[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 [email protected]
on 28 Aug 2012 at 5:35
from cefpython.
Original comment by [email protected]
on 28 Aug 2012 at 5:36
- Changed state: Accepted
from cefpython.
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 [email protected]
on 28 Aug 2012 at 7:51
- Changed state: Fixed
from cefpython.
Version 0.36 released, includes fix for this issue.
Original comment by [email protected]
on 29 Aug 2012 at 5:53
from cefpython.
Related Issues (20)
- The default en-US locale pak file fails to load on Mac HOT 3
- Examples crash on Mac when app doesn't have permission to write to the debug.log file
- Issues with size_t => int conversions when using cef_values.h API on Win x64 platform HOT 2
- Python Wheels - DESCRIPTION.rst UNKNOWN
- Embed __version__ also in the cython generated module (cefpython_py27.pyd) HOT 1
- Create unified key mappings for all platforms HOT 8
- Add Browser.IsDevTools() HOT 1
- Expose CreateBrowser() with a callback argument that will be executed after browser was created
- The popup window and parent window can't script each other in the wxpython.py example HOT 3
- Create "chrome31" branch before updating to a newer CEF branch HOT 1
- wxpython-response.py example: final url is wrong when doing redirects HOT 7
- Close the browser BEFORE the page is full loaded CEF Crashe HOT 1
- Warnings on OS X: Internals of CFAllocator not known HOT 1
- [meta] Migrate the repository somewhere HOT 2
- Gtk: gtk_disable_setlocale() must be called before gtk_init() HOT 2
- Restructure directories (binaries, installer, libraries) to allow for git branching HOT 1
- Automating navigation HOT 1
- Google Code is dying
- Update to CEF branch 2171 (Chrome 39) HOT 1
- Ability to pass modifiers to SendMouseMoveEvent and similar
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cefpython.