I want to know if # -- using utf8 --
is the same in PA? iwant to put after #!/usr/bin/python
I am facing some error ValueError: All strings must be XML compatible: Unicode or ASCII, no NULL bytes or control characters
which I want to fix
I want to know if # -- using utf8 --
is the same in PA? iwant to put after #!/usr/bin/python
I am facing some error ValueError: All strings must be XML compatible: Unicode or ASCII, no NULL bytes or control characters
which I want to fix
I try to declare with # coding: utf-8
also not working. I am suing Flask
The comment to set the coding should be
# -*- coding: utf-8 -*-
...on a new line after the initial hashbang line -- note the dashes and stars. Could you try that and see what happens?
Hi giles,
It does not work. It works on my local pc though but fail in PA with the error shown in the first post.
1 2 3 4 5 6 7 8 9 10 11 12 |
|
I don't know when I move to PA, it just repeated the ASCII error.
In line 11 the argument to xpath needs to be a Unicode literal, so prefix with u.
a = xpath(u'//div[...
What is the full error stacktrace btw? If it's line 11, aren't you just trying to give it unicode characters while xpath is saying it doesn't accept unicode characters? "ValueError: All strings must be XML compatible: Unicode or ASCII, no NULL bytes or control characters"
Hi conrad,
u' eliminate the error.
However, I still find that the Thai do not take effect. No matter I change the Thai words the output of xpath still the same
What's the return value that you get from the th.xpath
function?