[Tutor] name shortening in a csv module output

Jim Mooney cybervigilante at gmail.com
Thu Apr 23 20:14:52 CEST 2015


>
> By relying on the default when you read it, you're making an unspoken
> assumption about the encoding of the file.
>
> --
> DaveA


So is there any way to sniff the encoding, including the BOM (which appears
to be used or not used randomly for utf-8), so you can then use the proper
encoding, or do you wander in the wilderness? I was going to use encoding =
utf-8 as a suggested default. I noticed it got rid of the bom symbols but
left an extra blank space at the beginning of the stream. Most books leave
unicode to the very end, if they mention the BOM at all (mine is at page
977, which is still a bit off ;')


More information about the Tutor mailing list