i replaced (in class Parser, method fromFile)<br>
StreamReader sr = new StreamReader(File.OpenRead(filename), System.Text.Encoding.ASCII);<br>
with<br>
StreamReader sr = new StreamReader(File.OpenRead(filename), System.Text.Encoding.Default);<br>
<br>
and PythonEngine.ExecuteFile() now display correctly<br>
<br>
<br>
<br><br><div><span class="gmail_quote">在05-8-11,<b class="gmail_sendername">徐宁</b> &lt;<a href="mailto:alcarx@gmail.com">alcarx@gmail.com</a>&gt; 写道:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Just use the example shiped with IronPython9.0.<br>
<br>
Add a class named Embed5<br>
<br>
////////////////////////////////////////////////////////////////////////////////////////////<br>
public class Embed5<br>
{<br>
&nbsp;&nbsp;&nbsp; //the file to be executed<br>
&nbsp;&nbsp;&nbsp; const string fileName = @&quot;D:/TestChinese.py&quot;;<br>
<br>
&nbsp;&nbsp;&nbsp; public static void Run()<br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PythonEngine engine = new PythonEngine();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; engine.ExecuteFile(fileName);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Application.Run();<br>
&nbsp;&nbsp;&nbsp; }<br>
}<br>
//////////////////////////////////////////////////////////////////////////////////////////////<br>
And content of TestChinese.py is <br>
<br>
##########################################<br>
<br>
from System import *<br>
from System.Windows.Forms import *<br>
MessageBox.Show(&quot;你好,IronPython&quot;)<br>
<br>
#########################################<br>
<br>
in Program.cs add &quot;Embed5.Run();&quot;<br>
<br>
while i run this example, the string &quot;你好&quot; can't be correctly displayed.<br>
<br>
but if i use IronPythonConsole to execute&nbsp; MessageBox.Show(&quot;你好,IronPython&quot;),<br>
it works fine<br>
<br>
<br>
<br><div><span class="gmail_quote">2005/8/11, Martin Maly &lt;<a href="mailto:martmaly@exchange.microsoft.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">martmaly@exchange.microsoft.com</a>&gt;:
</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><span class="e" id="q_105a3a419e394bf5_1">





<div align="left" dir="ltr"><span><font face="Verdana" size="2">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.</font></span></div>
<div align="left" dir="ltr"><span><font face="Verdana" size="2"></font></span>&nbsp;</div>
<div align="left" dir="ltr"><span><font face="Verdana" size="2">Martin</font></span></div><br>
<blockquote style="border-left: 2px solid rgb(0, 0, 0); padding-left: 5px; margin-left: 5px; margin-right: 0px;" dir="ltr">
  <div align="left" dir="ltr" lang="en-us">
  <hr>
  <font face="Tahoma" size="2"><b>From:</b> 
  <a href="mailto:users-ironpython.com-bounces@lists.ironpython.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">users-ironpython.com-bounces@lists.ironpython.com</a> 
  [mailto:<a href="mailto:users-ironpython.com-bounces@lists.ironpython.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">users-ironpython.com-bounces@lists.ironpython.com</a>] <b>On Behalf Of 
  </b>??<br><b>Sent:</b> Wednesday, August 10, 2005 9:22 AM<br><b>To:</b> 
  <a href="mailto:users-ironpython.com@lists.ironpython.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">users-ironpython.com@lists.ironpython.com</a><br><b>Subject:</b> [IronPython] 
  language Support-Chinese<br></font><br></div><div><span>
  <div></div>
  <div>it seems that ironpython does not support chinese.</div>
  <div>&nbsp;</div>
  <div>i used ironpython in one project</div>
  <div>&nbsp;</div>
  <div>and&nbsp;tried to display some information in chinese ,</div>
  <div>&nbsp;</div>
  <div>but these words can't be correctly displayed.</div>
  <div>&nbsp;</div>
  <div>i wonder if u could kindly give me some advice on sovling this 
  problem.</div>
  <div>&nbsp;</div></span></div></blockquote></span></div>

<br>_______________________________________________<br><a href="http://users-ironpython.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">users-ironpython.com</a> mailing list<span class="q"><br>
<a href="mailto:users-ironpython.com@lists.ironpython.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
users-ironpython.com@lists.ironpython.com</a><br></span><a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
</a><br><br><br></blockquote></div><br><br><br>-- <br>The shift of focus (to patterns) will <br>have a profound and enduring effect <br>on the way we write programs.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--Ward Cunningham and Ralph Johnson
</blockquote></div><br><br><br>-- <br>The shift of focus (to patterns) will <br>have a profound and enduring effect <br>on the way we write programs.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--Ward Cunningham and Ralph Johnson