S
Stens
Can python handle this characters: ć,Ä,ž,Ä‘,Å¡?
If can how"
If can how"
Stens said:Can python handle this characters: ć,Ä,ž,Ä‘,Å¡?
If can how"
Stens said:Can python handle this characters: ć,Ä,ž,Ä‘,Å¡?
yes.
If can how"
I wanna to change some characters in text (in the file) to theStens said:Can python handle this characters: ć,Ä,ž,Ä‘,Å¡?
If can how"
I wanna to change some characters in text (in the file) to the
characters at this address:
http://rapidshare.de/files/37244252/Untitled-1_copy.png.html
[snip]
outfile.write(line.replace(u'd',u'd'))
thx LeoLeo said:You need to use unicode, see any python unicode tutorial, for example
this one http://www.amk.ca/python/howto/unicode or any other you can
find with google.
Your script can look like this:
# -*- coding: PUT-HERE-ENCODING-OF-THIS-SCRIPT-FILE -*-
import codecs
outfile = codecs.open("your output file", "w", "encoding of the output
file"):
for line in codecs.open("your input file", "r", "encoding of the input
file"):
outfile.write(line.replace(u'd',u'd'))
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.