Putting Unicode characters in JSON

Grant Edwards grant.b.edwards at gmail.com
Fri Mar 23 11:13:52 EDT 2018


On 2018-03-23, Richard Damon <Richard at Damon-Family.org> wrote:

> One comment on this whole argument, the original poster asked how to get 
> data from a database that WAS using Latin-1 encoding into JSON (which 
> wants UTF-8 encoding) and was asking if something needed to be done 
> beyond using .decode('Latin-1'), and in particular if they need to use a 
> .encode('UTF-8'). The answer should be a simple Yes or No.
>
> Instead, someone took the opportunity to advocate that a wholesale 
> change to the database was the only reasonable course of action.

Well, this is (somewhat) Usenet, where the most common answer to "How
do I do X?"  is usually "X is stupid. You don't want to do X. You
should do Y."  This is generally followed by somebody proposing Z
instead of Y and a long debate about the relative merits of Y and Z.

One learns to either justify X or just ingore the subthreads about Y
and Z.  Except sometimes the answer _is_ that you really don't want to
do X, and probably should do Y or Z.

-- 
Grant Edwards               grant.b.edwards        Yow! Oh my GOD -- the
                                  at               SUN just fell into YANKEE
                              gmail.com            STADIUM!!




More information about the Python-list mailing list