I'm try to build a bundle on OS X, so I write a simple python script
for a test:
#!/usr/bin/env python
import EasyDialogs
EasyDialogs.Message("Hello,Mac!")
This runs OK,but when I try to replace "Hello,Mac!" with chinese, it
can't be display rightly.
Then I tried some way else:
#!/usr/bin/env python
import EasyDialogs
EasyDialogs.Message("\xe4\xb8\xad")
It doesn't work!
As I know mac is unicode based,how can I display chinese on the screen? 7 2058
try unicode?
"kernel1983 дµÀ£º
"
I'm try to build a bundle on OS X, so I write a simple python script
for a test:
#!/usr/bin/env python
import EasyDialogs
EasyDialogs.Message("Hello,Mac!")
This runs OK,but when I try to replace "Hello,Mac!" with chinese, it
can't be display rightly.
Then I tried some way else:
#!/usr/bin/env python
import EasyDialogs
EasyDialogs.Message("\xe4\xb8\xad")
It doesn't work!
As I know mac is unicode based,how can I display chinese on the screen?
and I tried unicode and utf-8
I tried to both use unicode&utf-8 head just like "\xEF\xBB\xBF" and not
to use
Anyone knows about the setting in the python code file?
Maybe python doesn't know I'm to use chinese?!
On 12ÔÂ13ÈÕ, ÏÂÎç12ʱ47·Ö, "bearsprite" <bearspr...@gmail.com>
wrote:
try unicode?
"kernel1983 дµÀ£º
"
I'm try to build a bundle on OS X, so I write a simple python script
for a test:
#!/usr/bin/env python
import EasyDialogs
EasyDialogs.Message("Hello,Mac!")
This runs OK,but when I try to replace "Hello,Mac!" with chinese, it
can't be display rightly.
Then I tried some way else:
#!/usr/bin/env python
import EasyDialogs
EasyDialogs.Message("\xe4\xb8\xad")
It doesn't work!
As I know mac is unicode based,how can I display chinese on the screen?
kernel1983 wrote:
and I tried unicode and utf-8
How did you try unicode? Like this? :
EasyDialogs.Message(u'\u4e2d')
I tried to both use unicode&utf-8 head just like "\xEF\xBB\xBF" and not
to use
Anyone knows about the setting in the python code file?
Maybe python doesn't know I'm to use chinese?!
It depends on how EasyDialogs works. And by the way, when you say utf-8
encoded text is not displayed correctly, what do you actually see on
the screen?
-- Leo
Leo Kislov wrote:
kernel1983 wrote:
and I tried unicode and utf-8
How did you try unicode? Like this? :
EasyDialogs.Message(u'\u4e2d')
I tried to both use unicode&utf-8 head just like "\xEF\xBB\xBF" and not
to use
Anyone knows about the setting in the python code file?
Maybe python doesn't know I'm to use chinese?!
It depends on how EasyDialogs works. And by the way, when you say utf-8
encoded text is not displayed correctly, what do you actually see on
the screen?
There is a Windows version of EasyDialogs -- unfortunately it appears
not to support Unicode, even for the most simple case.
This works:
| >>EasyDialogs.Message('fubar')
but this doesn't:
| >>EasyDialogs.Message(u'fubar')
The title of the window is empty, the text consists of only 'f", and
there is no OK button.
Not very robust.
kernel1983 wrote:
I'm try to build a bundle on OS X, so I write a simple python script
for a test:
#!/usr/bin/env python
import EasyDialogs
EasyDialogs.Message("Hello,Mac!")
This runs OK,but when I try to replace "Hello,Mac!" with chinese, it
can't be display rightly.
Then I tried some way else:
#!/usr/bin/env python
import EasyDialogs
EasyDialogs.Message("\xe4\xb8\xad")
It doesn't work!
As I know mac is unicode based,how can I display chinese on the screen?
EasyDialogs is an *ancient* module on OS X--it may not support unicode.
Try posting to the MacPython list, someone there can verify this.
--Kevin
--
Kevin Walzer
Code by Kevin http://www.codebykevin.com
Dennis Lee Bieber wrote:
On 12 Dec 2006 23:40:41 -0800, "kernel1983" <ke********@gmail.com>
declaimed the following in gmane.comp.python.general:
and I tried unicode and utf-8
I tried to both use unicode&utf-8 head just like "\xEF\xBB\xBF" and not
to use
"unicode" is a term covering many sins. "utf-8" is a specification
for encoding elements of specific unicode characters using 8-bit
elements (I believe by using certain codes x00 to x7F alone as "normal",
and then x80 to xFF to represent an "escape" to higher [16-bit] element
sets).
"\xEF\xBB\xBF" is just a byte string with no identifier of what
encoding is in use (unless the first one or two are supposed to be
BOM)... In the "Windows: Western" character set, it is equivalent to
small-i-diaeresis/right-guillemot/upside-down? () In MS-DOS: Western
Europe, those same bytes represent an
acute-accent/double-down&left-box-drawing/solid-down&left
I've not done any unicode work (iso-latin-1, or subset thereof, has
done for me). I also don't know Mac's, so I don't know if the windowing
API has specific calls for Unicode data... But you probably have to
encode or decod that bytestring into some compatible unicode
representation.
When you save a textfile as UTF-8 in Notepad.exe (Windows) it puts the
bytestring "\xEF\xBB\xBF" at the start to indicate that it's UTF-8 and
not ANSI (ie 8-bit characters). The bytes are actually the BOM
bytestring "\xFE\xFF" encoded in UTF-8.
thanks everyone
maybe this simple API doesn't fit the Chinese display
but thanks everybody!
At least I've got that what bundles is and maybe I can use Python to
write program
On 12ÔÂ14ÈÕ, ÉÏÎç6ʱ31·Ö, "MRAB" <goo...@mrabarnett..plus.com>
wrote:
Dennis Lee Bieber wrote:
On 12 Dec 2006 23:40:41 -0800, "kernel1983" <kernel1...@gmail.com>
declaimed the following in gmane.comp.python.general:
and I tried unicode and utf-8
I tried to both use unicode&utf-8 head just like "\xEF\xBB\xBF" and not
to use
"unicode" is a term covering many sins. "utf-8" is a specification
for encoding elements of specific unicode characters using 8-bit
elements (I believe by using certain codes x00 to x7F alone as "normal",
and then x80 to xFF to represent an "escape" to higher [16-bit] element
sets).
"\xEF\xBB\xBF" is just a byte string with no identifier of what
encoding is in use (unless the first one or two are supposed to be
BOM)... In the "Windows: Western" character set, it is equivalent to
small-i-diaeresis/right-guillemot/upside-down? () In MS-DOS: Western
Europe, those same bytes represent an
acute-accent/double-down&left-box-drawing/solid-down&left
I've not done any unicode work (iso-latin-1, or subset thereof, has
done for me). I also don't know Mac's, so I don't know if the windowing
API has specific calls for Unicode data... But you probably have to
encode or decod that bytestring into some compatible unicode
representation.When you save a textfile as UTF-8 in Notepad.exe (Windows) it puts the
bytestring "\xEF\xBB\xBF" at the start to indicate that it's UTF-8 and
not ANSI (ie 8-bit characters). The bytes are actually the BOM
bytestring "\xFE\xFF" encoded in UTF-8.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Posadas, Dennis |
last post by:
Hi,
I've done some google searching w/c referred me to a couple of
articles on unicode, but I'm looking for something really simple - not
for a...
|
by: Anthony Liu |
last post by:
The following 4 lines of code parses an XML document
very well if the XML document contains only English
words.
But when I insert one Chinese...
|
by: Nick Evans |
last post by:
Hello there,
I have been on and off learning to code (with python being the second
language I have worked on after a bit of BASIC). What I really...
|
by: Anthony Liu |
last post by:
I believe that topic related to Chinese processing was
discussed before. I could not dig out the info I want
from the mail list archive.
My...
|
by: =?gb2312?B?u7W1sA==?= |
last post by:
It's really annoying to find there are all English language posts here
because I wanna talk about something about the Chinese related
programs.
...
|
by: James T. Dennis |
last post by:
You'd think that using things like gettext would be easy. Superficially
it seems well documented in the Library Reference(*). However, it can
be...
|
by: Steve Howell |
last post by:
The never-ending debate about PEP 3131 got me thinking
about natural languages with respect to Python, and I
have a bunch of mostly simple...
|
by: devito |
last post by:
hi there,
for some days i try to build the boost.python tutorial "hello world"
without bjam on winxp by using mingw.
so i wrote a *.bat-file...
|
by: Gerardo Herzig |
last post by:
Hi all. Im having some "problems" with a small concurrent plpython function.
Based on a small example about concurrent programming, there is some...
|
by: concettolabs |
last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
|
by: better678 |
last post by:
Question:
Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct?
Answer:
Java is an object-oriented...
|
by: Kemmylinns12 |
last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
|
by: CD Tom |
last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
|
by: CD Tom |
last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
|
by: antdb |
last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine
In the overall architecture, a new "hyper-convergence" concept was...
|
by: Matthew3360 |
last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function.
Here is my code.
...
|
by: AndyPSV |
last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
|
by: WisdomUfot |
last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
| |