unicode encoding usablilty problem
Fredrik Lundh
fredrik at pythonware.com
Mon Feb 21 06:00:46 EST 2005
"aurora" <aurora00 at gmail.com> wrote:
>> if you don't know what a and b comes from, how can you be sure that
>> your program works at all? how can you be sure they're both strings?
>
> a and b are both string.
how do you know that?
>> if you have unit tests, why don't they include Unicode tests?
>
> How do I structure the test cases to guarantee coverage? It is not practical to test every
> combinations of unicode/8-bit strings. Adding non-ascii characters to test data probably make
> problem pop up earlier. But it is arduous
sounds like you don't want to test for it. sorry, cannot help. I prefer
to design libraries so they can be tested, and design tests so they test all
important aspects of my libraries. if you prefer another approach, there's
not much I can do, other than repeating what I said at the start: if you do
things the right way (decode on the way in, encode on the way out), it
just works.
</F>
More information about the Python-list
mailing list