I have the next text file named “ent” with the next 3 lines:
HierroPitón
--> áéíóúñÑü¿?¡! <--
Adiós.

I execute the next script in IP

>>>e=open("c:/ent", "r")
>>>for i in e.readlines():
...     print i
...
HierroPit?n

--> ???????????! <--

Adi?s.

>>>e.close()

I hope you see the problem produced. Some common letters in the spanish 
language the ones with accent were replaced by another characters. May be 
unicode is the cause.


To avoid this issue in C#, I use System.Text.Encoding.Default i.e.:
r=new StreamReader(@"C:\ent", System.Text.Encoding.Default);
or
w=new StreamWriter(@"C:\ent", False, System.Text.Encoding.Default);
Depending if I read and/or write data

How can I solve this in IP?
Best regards

_________________________________________________________________
Charla con tus amigos en línea mediante MSN Messenger: 
http://messenger.latam.msn.com/

_______________________________________________
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to