On Jan 15, 4:09 pm, "Martin v. Löwis" wrote:
> >> One of self.title and self.content is a Unicode string, the other is
> >> a byte string. You need to change them to have the same type (depending
> >> on whether you want to process them as Unicode or byte strings).
>
> > How can I do that?
>
> Fir
>> One of self.title and self.content is a Unicode string, the other is
>> a byte string. You need to change them to have the same type (depending
>> on whether you want to process them as Unicode or byte strings).
>>
>
> How can I do that?
First, you need to find out what the respective types ar
On Jan 15, 3:34 pm, "Martin v. Löwis" wrote:
> > rc_file.write("\n\n".join([self.title, "### BEGIN CONTENT ###",
> > self.content]))
> > .
> > UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position
> > 442: ordinal not in range()
>
> > What should I change to make thi
> rc_file.write("\n\n".join([self.title, "### BEGIN CONTENT ###",
> self.content]))
> .
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position
> 442: ordinal not in range()
>
> What should I change to make this unicode-safe?
One of self.title and self.content is a
This line of code is throwing a UnicodeError for a handful of the few
hundred files I'm processing:
rc_file.write("\n\n".join([self.title, "### BEGIN CONTENT ###",
self.content]))
.
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position
442: ordinal not in range()
Wh