L
Lukas Kasprowicz
Hi Folks,
I have a string filled with much text converted from a tuple.
when I try to do someting like this:
exclusion = re.sub("\\xf6", "%F6", exclusion) # ö
exclusion = re.sub("\\xfc", "%FC", exclusion) # ü
exclusion = re.sub("\\xe4", "%E4", exclusion) # ä
exclusion = re.sub("\\xdf", "%DF", exclusion) # ß
it takes no effect at the string.
things like:
exclusion = re.sub(',', '', exclusion)
exclusion = re.sub('\(', '', exclusion)
exclusion = re.sub('\)', '', exclusion)
exclusion = re.sub("'", "", exclusion)
exclusion = re.sub(" ", "+%2D", exclusion)
work fine.
when i write the sting in a python console into a variable like:
some%F6thing
I get the correct output.
Why do I can not do a substitute on "\\xf6" or simmilar, but on other I can
do it (like "\(")
I tried with unicode() converting to I think it was from latin-1 to utf-8
and back. with the python console it worked but not with the string that
was converted from tuple before.
greetz Lukas
I have a string filled with much text converted from a tuple.
when I try to do someting like this:
exclusion = re.sub("\\xf6", "%F6", exclusion) # ö
exclusion = re.sub("\\xfc", "%FC", exclusion) # ü
exclusion = re.sub("\\xe4", "%E4", exclusion) # ä
exclusion = re.sub("\\xdf", "%DF", exclusion) # ß
it takes no effect at the string.
things like:
exclusion = re.sub(',', '', exclusion)
exclusion = re.sub('\(', '', exclusion)
exclusion = re.sub('\)', '', exclusion)
exclusion = re.sub("'", "", exclusion)
exclusion = re.sub(" ", "+%2D", exclusion)
work fine.
when i write the sting in a python console into a variable like:
some%F6thing
I get the correct output.
Why do I can not do a substitute on "\\xf6" or simmilar, but on other I can
do it (like "\(")
I tried with unicode() converting to I think it was from latin-1 to utf-8
and back. with the python console it worked but not with the string that
was converted from tuple before.
greetz Lukas