[IronPython] language Support-Chinese
徐宁
alcarx at gmail.com
Fri Aug 12 10:39:12 CEST 2005
i replaced (in class Parser, method fromFile)
StreamReader sr = new StreamReader(File.OpenRead(filename),
System.Text.Encoding.ASCII);
with
StreamReader sr = new StreamReader(File.OpenRead(filename),
System.Text.Encoding.Default);
and PythonEngine.ExecuteFile() now display correctly
在05-8-11,徐宁 <alcarx at gmail.com> 写道:
>
> Just use the example shiped with IronPython9.0.
>
> Add a class named Embed5
>
>
> ////////////////////////////////////////////////////////////////////////////////////////////
> public class Embed5
> {
> //the file to be executed
> const string fileName = @"D:/TestChinese.py";
>
> public static void Run()
> {
> PythonEngine engine = new PythonEngine();
> engine.ExecuteFile(fileName);
> Application.Run();
> }
> }
>
> //////////////////////////////////////////////////////////////////////////////////////////////
> And content of TestChinese.py is
>
> ##########################################
>
> from System import *
> from System.Windows.Forms import *
> MessageBox.Show("你好,IronPython")
>
> #########################################
>
> in Program.cs add "Embed5.Run();"
>
> while i run this example, the string "你好" can't be correctly displayed.
>
> but if i use IronPythonConsole to execute MessageBox.Show
> ("你好,IronPython"),
> it works fine
>
>
>
> 2005/8/11, Martin Maly <martmaly at exchange.microsoft.com>:
> >
> > Would it be possible for you to send us a short code snippet that you
> > had problem with? I would like to find out whether the problem is in
> > parsing, encoding usage, etc.
> > Martin
> >
> > ------------------------------
> > *From:* users-ironpython.com-bounces at lists.ironpython.com [mailto:
> > users-ironpython.com-bounces at lists.ironpython.com] *On Behalf Of *??
> > *Sent:* Wednesday, August 10, 2005 9:22 AM
> > *To:* users-ironpython.com at lists.ironpython.com
> > *Subject:* [IronPython] language Support-Chinese
> >
> > it seems that ironpython does not support chinese.
> > i used ironpython in one project
> > and tried to display some information in chinese ,
> > but these words can't be correctly displayed.
> > i wonder if u could kindly give me some advice on sovling this problem.
> >
> >
> > _______________________________________________
> > users-ironpython.com <http://users-ironpython.com> mailing list
> > users-ironpython.com at lists.ironpython.com
> > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> >
> >
> >
>
>
> --
> The shift of focus (to patterns) will
> have a profound and enduring effect
> on the way we write programs.
> --Ward Cunningham and Ralph Johnson
--
The shift of focus (to patterns) will
have a profound and enduring effect
on the way we write programs.
--Ward Cunningham and Ralph Johnson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20050812/7458c525/attachment.html>
More information about the Ironpython-users
mailing list