Code review comment for lp:~songofacandy/bzr/fix-523746-2

Revision history for this message
methane (songofacandy) wrote :

> > Multibyte encoding may contains '?' as a trailing char.
> > So ``full_path.encode('mbcs', 'replace').replace('?', '_')`` may break
> > multibyte char.
>
> Really? Even SJIS avoids that one, and it's pretty good at breaking naïve
> programs. I get the reasoning now though.

I've checked SJIS and BIG5 a little while ago, and find '?' (0x3f) is not in trailing char.
So replace('?', '_') may be safe.

But I doesn't like depending character mapping.
I think encoded string is magic bytes and modifying it is dangerous.

« Back to merge proposal