Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It would fail when you pass it 128. He's passing in values from 0-255. "Ascii" is sort of a misnomer in his post.


It's better to fail than to convert something that probably isn't latin1!


The latin1 codec doesn't fail for any values in the 0-255 range. It probably should, since there are values that don't map to a valid character. I don't know if this is deliberate and guaranteed or just an artifact of the current implementation. There should have been a 'byte' encoding that was explicitly made for 1:1 conversions.


Well, it's not clear what behavior he was looking for. And not possible to compare speed without an encoding that works for 0-255.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: