Do you want to change the characters in a picture!? Your question still
is *very* vague. Please provide a more detailed description of the
problem at hand.
What do you have? A text file? In which encoding? And what do you want
to achieve?
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("yo ur output file", "w", "encoding of the output
file"):
for line in codecs.open("yo ur input file", "r", "encoding of the input
file"):
outfile.write(l ine.replace(u'd ',u'd'))
On Oct 18, 11:50 am, Stens <sgi...@email .t-com.hrwrote:
Stens wrote:
Can python handle this characters: c,c,ž,d,š?
[snip]
outfile.write(l ine.replace(u'd ',u'd'))
I hope you'll do better than google engeers who mess up croatian
characters in new google groups. Of course the last 'd' should be latin
d with stroke. I really typed it but google swallowed the stroke.
This PEP proposes to introduce a syntax to declare the encoding of a Python source file. The encoding information is then used by the Python parser to interpret the file using the given encoding. Most notably this enhances the interpretation of Unicode ...
>
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("yo ur output file", "w", "encoding of the output
file"):
for line in codecs.open("yo ur input file", "r", "encoding of the input
file"):
outfile.write(l ine.replace(u'd ',u'd'))
>
Comment