[Tutor] UTF-8 filenames encountered in os.walk

Kent Johnson kent37 at tds.net
Thu Jul 5 03:05:43 CEST 2007

Terry Carroll wrote:
> I'm just saying that UTF-8 encodes ascii characters to themselves; but 
> UTF-8 is not the same as ascii.
> I think we're ultimately saying the same thing; to merge both our ways of
> putting it, I think, is that ascii will map to UTF-8 identically; but
> UTF-8 may map back or it will raise UnicodeDecodeError.
> I just didn't want to leave the impression "Yeah, UTF-8 & ascii, they're
> the same thing."

I hope neither of us gave that impression! I think you are right, we 
just have different ways of thinking about it. Any ascii string is also 
a valid utf-8 string (and latin-1, and many other encodings), but the 
opposite is not true.


More information about the Tutor mailing list