es-AR country codes in product-details are unicode escaped for javascript

RESOLVED DUPLICATE of bug 1018447

Status

www.mozilla.org
Product Details
RESOLVED DUPLICATE of bug 1018447
3 years ago
3 years ago

People

(Reporter: pascalc, Assigned: sylvestre)

Tracking

Development/Staging
x86_64
Linux

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
Created attachment 8505392 [details]
es-AR_country_list_bug.png

See screenshot, the country list is unicode escaped for js. Since the data in Product-details was imported from toolkit, that is probably because the country name were inserted at a time when our properties files couldn't be in UTF8.

We should unescape country names at json generation  so as to generate country lists that are suitable in a non-JS context (there may be other locales affected, haven't checked).
(Assignee)

Updated

3 years ago
Assignee: nobody → sledru
(Assignee)

Comment 1

3 years ago
With this patch (as suggested by Pascal on IRC):
Index: export_json.php
===================================================================
--- export_json.php     (révision 133155)
+++ export_json.php     (copie de travail)
@@ -21,7 +21,7 @@
  */
 function writefile($filename, $data)
 {
-    file_put_contents(JSONDIR.$filename, json_encode($data, JSON_PRETTY_PRINT));
+    file_put_contents(JSONDIR.$filename, json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
 }
 
 /** Locale Details */


This fixes some of the problems but not all of them.
For example, es-AR json files:
$ svn diff json/regions/es-AR.json
Index: json/regions/es-AR.json
===================================================================
--- json/regions/es-AR.json	(révision 133155)
+++ json/regions/es-AR.json	(copie de travail)
@@ -193,7 +193,7 @@
     "vc": "Saint Vincent and the Grenadines",
     "ws": "Samoa",
     "as": "Samoa Americana",
-    "bl": "San Bartolom\u00e9",
+    "bl": "San Bartolomé",
     "sm": "San Marino",
     "pm": "San Pedro y Miquelon",
     "sh": "Santa Helena",


On the overall aspect, I think this might have some side effects on projects using the json files.
(Assignee)

Updated

3 years ago
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1018447
You need to log in before you can comment on or make changes to this bug.