json export in 5.0 beta 3

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

json export in 5.0 beta 3

StoltHD
Json export does not support UTF-8/UNICODE ... or atleast does not support Norwegian ÆØÅ æøå.

THe resultwhen open it in Notepad++ on windows is like this :

Arkiv: Statistisk sentralbyr\u00e5,

Should be:

Arkiv: Statistisk sentralbyrå


This happens with all letters (doublebite), it does not help to change code format in NP++.

Can you please fix this.

most likely its the same problem in version 4.x.x to...


The same exportt to XML show letters as it should


Jaran G. Heggen

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: json export in 5.0 beta 3

Nick Hall
On 08/04/18 23:01, StoltHD wrote:

> Json export does not support UTF-8/UNICODE ... or atleast does not
> support Norwegian ÆØÅ æøå.
>
> THe resultwhen open it in Notepad++ on windows is like this :
>
> Arkiv: Statistisk sentralbyr\u00e5,
>
> Should be:
>
> Arkiv: Statistisk sentralbyrå
>
>
> This happens with all letters (doublebite), it does not help to change
> code format in NP++.
>
> Can you please fix this.
>
> most likely its the same problem in version 4.x.x to...
>
>
> The same exportt to XML show letters as it should

Both representations are actually valid json, but the unicode is easier
to read.

It should be as easy as specifying "ensure_ascii=False" option. I'll
create a PR.

Nick.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: json export in 5.0 beta 3

StoltHD
Thanks,

I was not sure I made my self understandable ...
I saw later that the jsviewer in NP++ presented it "readable"...
But the same problem also occured in Visual Studio 2017, when opening the json there... And I do not know how to change it....
(still in early learning phase)

Jaran G.

2018-04-09 0:36 GMT+02:00 Nick Hall <[hidden email]>:
On 08/04/18 23:01, StoltHD wrote:
Json export does not support UTF-8/UNICODE ... or atleast does not support Norwegian ÆØÅ æøå.

THe resultwhen open it in Notepad++ on windows is like this :

Arkiv: Statistisk sentralbyr\u00e5,

Should be:

Arkiv: Statistisk sentralbyrå


This happens with all letters (doublebite), it does not help to change code format in NP++.

Can you please fix this.

most likely its the same problem in version 4.x.x to...


The same exportt to XML show letters as it should

Both representations are actually valid json, but the unicode is easier to read.

It should be as easy as specifying "ensure_ascii=False" option. I'll create a PR.

Nick.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: json export in 5.0 beta 3

Nick Hall
Yes, it is perfectly valid json.  See:

http://json.org/

The python json library escapes unicode characters by default, but we don't have to do this.

https://docs.python.org/3/library/json.html#basic-usage

I have created a PR:

https://github.com/gramps-project/gramps/pull/595


Nick.


On 08/04/18 23:56, StoltHD wrote:
Thanks,

I was not sure I made my self understandable ...
I saw later that the jsviewer in NP++ presented it "readable"...
But the same problem also occured in Visual Studio 2017, when opening the json there... And I do not know how to change it....
(still in early learning phase)

Jaran G.

2018-04-09 0:36 GMT+02:00 Nick Hall <[hidden email]>:
On 08/04/18 23:01, StoltHD wrote:
Json export does not support UTF-8/UNICODE ... or atleast does not support Norwegian ÆØÅ æøå.

THe resultwhen open it in Notepad++ on windows is like this :

Arkiv: Statistisk sentralbyr\u00e5,

Should be:

Arkiv: Statistisk sentralbyrå


This happens with all letters (doublebite), it does not help to change code format in NP++.

Can you please fix this.

most likely its the same problem in version 4.x.x to...


The same exportt to XML show letters as it should

Both representations are actually valid json, but the unicode is easier to read.

It should be as easy as specifying "ensure_ascii=False" option. I'll create a PR.

Nick.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel