@@ -234,9 +234,9 @@ def read_as_json(filename):
234234 with open (filename ) as f :
235235 return json .load (f )
236236
237- def write_as_json (filename , data ):
237+ def write_as_json (filename , data , ensure_ascii = True ):
238238 with open (filename , "w" ) as f :
239- json .dump (data , f , indent = 4 , sort_keys = True )
239+ json .dump (data , f , indent = 4 , sort_keys = True , ensure_ascii = ensure_ascii )
240240
241241def write_lines (filename , lines ):
242242 with open (filename , "w" ) as f :
@@ -967,7 +967,7 @@ def process_assets(tmp_dir):
967967 asset ["asset_url" ] = "https://github.com/defold/asset-portal/blob/master/assets/%s.json" % asset_id
968968 if "github.com" in library_url :
969969 asset ["github_url" ] = re .sub (r"(.*github.com/.*?/.*?)/.*" , r"\1" , library_url )
970- write_as_json (asset_file , asset )
970+ write_as_json (asset_file , asset , False )
971971
972972 # build asset index
973973 assetindex .append ({
@@ -1033,25 +1033,25 @@ def process_assets(tmp_dir):
10331033
10341034 # write asset index
10351035 assetindex .sort (key = lambda x : x .get ("id" ).lower ())
1036- write_as_json (ASSETINDEX_JSON , assetindex )
1036+ write_as_json (ASSETINDEX_JSON , assetindex , False )
10371037
10381038 # write author index
10391039 authorlist = authorindex .values ()
10401040 authorlist = sorted (authorlist , key = lambda x : x .get ("name" ).lower ())
1041- write_as_json (AUTHORINDEX_JSON , authorlist )
1041+ write_as_json (AUTHORINDEX_JSON , authorlist , False )
10421042
10431043 # write author data and a dummy markdown page with front matter
10441044 for author in authorlist :
10451045 author ["assets" ].sort (key = lambda x : x .get ("id" ))
10461046 filename = os .path .join (author_data_dir , author ["id" ] + ".json" )
1047- write_as_json (filename , author )
1047+ write_as_json (filename , author , False )
10481048 with open (os .path .join (author_collection_dir , author ["id" ] + ".md" ), "w" ) as f :
10491049 f .write (AUTHOR_MD_FRONTMATTER .format (author ["id" ], author ["name" ]))
10501050
10511051 # write tag index
10521052 taglist = tagindex .values ()
10531053 taglist = sorted (taglist , key = lambda x : x .get ("id" ).lower ())
1054- write_as_json (TAGINDEX_JSON , taglist )
1054+ write_as_json (TAGINDEX_JSON , taglist , False )
10551055
10561056 # write platform index
10571057 # platformlist = platformindex.values()
@@ -1071,7 +1071,7 @@ def process_assets(tmp_dir):
10711071 # _data/tags
10721072 filename = os .path .join (tag_data_dir , tag ["id" ] + ".json" )
10731073 with open (filename , "w" ) as f :
1074- f .write (json .dumps (tag , indent = 2 , sort_keys = False ))
1074+ f .write (json .dumps (tag , indent = 2 , sort_keys = True , ensure_ascii = False ))
10751075
10761076 # tags/stars, tags/timestamp
10771077 for sort_order in sort_orders :
0 commit comments