I'm having trouble sending an html code through JSON.
I'm noticing my string values are different between python versions (2.7 and 3.5)
My string being something like: <html><p>PAÇOCA</p></html>
on Python 2.7:
x = '<html><p>PAÇOCA</p></html>'
base64.b64encode(x)
=> PGh0bWw+PHA+UEGAT0NBPC9wPjwvaHRtbD4=
on Python 3.5:
x = '<html><p>PAÇOCA</p></html>'
base64.b64encode(x)
=> b'PGh0bWw+PHA+UEHDh09DQTwvcD48L2h0bWw+'
Why are these values different? How can I make the 3.5 string equal to the 2.7?
This is causing me troubles with receiving e-mails due to the accents being lost.
PGh0bWw+PHA+UEGAT0NBPC9wPjwvaHRtbD4=is the [ cp437, cp850, cp852, cp857, cp858, cp860, cp861, cp863 or cp865 ] + base64 encoding of<html><p>PAÇOCA</p></html>PGh0bWw+PHA+UEHDh09DQTwvcD48L2h0bWw+is the UTF-8 + base64 encoding of<html><p>PAÇOCA</p></html>.