Advertisement
huutho_96

Decode String

Aug 16th, 2018
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 6.18 KB | None | 0 0
  1. # -*- coding: utf8 -*-
  2. arr = [
  3.     {
  4.         "currency": "VND",
  5.         "medical_services_limit": {
  6.             "2944": "",
  7.             "2947": "90.000.000 VN\u0110",
  8.             "2948": "4.500.000  VN\u0110",
  9.             "2949": "T\u1ed1i \u0111a \u0111\u1ebfn  s\u1ed1 ti\u1ec1n b\u1ea3o hi\u1ec3m",
  10.             "2950": "T\u1ed1i \u0111a \u0111\u1ebfn  s\u1ed1 ti\u1ec1n b\u1ea3o hi\u1ec3m",
  11.             "2951": "",
  12.             "2952": "4.500.000  VN\u0110",
  13.             "2953": "4.500.000 VN\u0110",
  14.             "2954": "4.500.000 VN\u0110",
  15.             "2955": "T\u1ed1i \u0111a \u0111\u1ebfn  s\u1ed1 ti\u1ec1n b\u1ea3o hi\u1ec3m",
  16.             "2956": "9.000.000 VN\u0110",
  17.             "2957": "T\u1ed1i \u0111a \u0111\u1ebfn  s\u1ed1 ti\u1ec1n b\u1ea3o hi\u1ec3m",
  18.             "2958": "90.000 VN\u0110",
  19.             "2959": "2.000.000 VN\u0110",
  20.             "2960": "450.000 VN\u0110",
  21.             "2961": "",
  22.             "2962": "Theo gi\u1edbi h\u1ea1n ph\u1ee5 1- \u0110i\u1ec1u ki\u1ec7n C",
  23.             "2963": "Theo gi\u1edbi h\u1ea1n ph\u1ee5 1- \u0110i\u1ec1u ki\u1ec7n C",
  24.             "2964": "Theo gi\u1edbi h\u1ea1n ph\u1ee5 1 v\u00e0 2- \u0110i\u1ec1u ki\u1ec7n C",
  25.             "2965": "",
  26.             "2966": "9.000.000 VN\u0110",
  27.             "2967": "2.700.000 VN\u0110",
  28.             "2968": "60.000 VN\u0110",
  29.             "2969": "2.700.000 VN\u0110",
  30.             "2970": "Kh\u00f4ng b\u1ea3o hi\u1ec3m",
  31.             "2972": "Kh\u00f4ng b\u1ea3o hi\u1ec3m",
  32.             "2973": "Kh\u00f4ng b\u1ea3o hi\u1ec3m",
  33.             "2974": "Kh\u00f4ng b\u1ea3o hi\u1ec3m",
  34.             "2908": "200.000.000 VN\u0110",
  35.             "2909": "Theo ba\u0309ng ty\u0309 l\u00ea\u0323 tr\u1ea3 ti\u1ec1n b\u1ea3o hi\u1ec3m th\u01b0\u01a1ng t\u1eadt",
  36.             "2910": "40.000.000 VN\u0110",
  37.             "2911": "30.000.000 VN\u0110",
  38.             "2912": "Vi\u1ec7t Nam\t\t",
  39.             "2937": "To\u00e0n c\u1ea7u",
  40.             "2939": "Vi\u1ec7t Nam\t\t",
  41.             "2940": "T\u1eed vong, t\u00e0n t\u1eadt to\u00e0n b\u1ed9 v\u0129nh vi\u1ec7n do \u1ed1m \u0111au, b\u1ec7nh t\u1eadt, thai s\u1ea3n",
  42.             "2941": "200.000.000 VN\u0110",
  43.             "2943": "Chi ph\u00ed n\u1eb1m vi\u1ec7n, ph\u1eabu thu\u1eadt v\u00e0 chi ph\u00ed kh\u00e1c do \u1ed1m \u0111au, b\u1ec7nh t\u1eadt, thai s\u1ea3n"
  44.         },
  45.         "age_groups_premium": {
  46.             "2064": "1.800.000 ",
  47.             "2059": "400.000 ",
  48.             "2060": "180.000 "
  49.         },
  50.         "name": "Ch\u01b0\u01a1ng tr\u00ecnh 1 ",
  51.         "treatment_area": "Vi\u1ec7t Nam "
  52.     },
  53.     {
  54.         "currency": "VND",
  55.         "medical_services_limit": {
  56.             "2944": "",
  57.             "2947": "150.000.000  VN\u0110",
  58.             "2948": "7.500.000 VN\u0110",
  59.             "2949": "T\u1ed1i \u0111a \u0111\u1ebfn s\u1ed1 ti\u1ec1n b\u1ea3o hi\u1ec3m",
  60.             "2950": "T\u1ed1i \u0111a \u0111\u1ebfn s\u1ed1 ti\u1ec1n b\u1ea3o hi\u1ec3m",
  61.             "2951": "",
  62.             "2952": "7.500.000 VN\u0110",
  63.             "2953": "7.500.000 VN\u0110",
  64.             "2954": "7.500.000 VN\u0110",
  65.             "2955": "T\u1ed1i \u0111a \u0111\u1ebfn s\u1ed1 ti\u1ec1n b\u1ea3o hi\u1ec3m",
  66.             "2956": "15.000.000  VN\u0110",
  67.             "2957": "T\u1ed1i \u0111a \u0111\u1ebfn s\u1ed1 ti\u1ec1n b\u1ea3o hi\u1ec3m",
  68.             "2958": "150.000  VN\u0110",
  69.             "2959": "2.000.000  VN\u0110",
  70.             "2960": "750.000  VN\u0110",
  71.             "2961": "",
  72.             "2962": "Theo gi\u1edbi h\u1ea1n ph\u1ee5 1- \u0110i\u1ec1u ki\u1ec7n C",
  73.             "2963": "Theo gi\u1edbi h\u1ea1n ph\u1ee5 1- \u0110i\u1ec1u ki\u1ec7n C",
  74.             "2964": "Theo gi\u1edbi h\u1ea1n ph\u1ee5 1 v\u00e0 2- \u0110i\u1ec1u ki\u1ec7n C ",
  75.             "2965": "",
  76.             "2966": "15.000.000  VN\u0110",
  77.             "2967": "4.500.000  VN\u0110",
  78.             "2968": "60,000  VN\u0110",
  79.             "2969": "4.500.000 ",
  80.             "2970": "Kh\u00f4ng b\u1ea3o hi\u1ec3m",
  81.             "2972": "Kh\u00f4ng b\u1ea3o hi\u1ec3m",
  82.             "2973": "Kh\u00f4ng b\u1ea3o hi\u1ec3m",
  83.             "2974": "Kh\u00f4ng b\u1ea3o hi\u1ec3m",
  84.             "2908": " 300.000.000  VN\u0110",
  85.             "2909": "Kh\u00f4ng b\u1ea3o hi\u1ec3m ",
  86.             "2910": "60.000.000  VN\u0110",
  87.             "2911": "60.000.000  VN\u0110",
  88.             "2912": "Vi\u1ec7t Nam VN\u0110",
  89.             "2937": "To\u00e0n c\u1ea7u",
  90.             "2939": "Vi\u1ec7t Nam\t",
  91.             "2940": "T\u1eed vong, t\u00e0n t\u1eadt to\u00e0n b\u1ed9 v\u0129nh vi\u1ec7n do \u1ed1m \u0111au, b\u1ec7nh t\u1eadt, thai s\u1ea3n",
  92.             "2941": "300.000.000 VN\u0110",
  93.             "2943": "Chi ph\u00ed n\u1eb1m vi\u1ec7n, ph\u1eabu thu\u1eadt v\u00e0 chi ph\u00ed kh\u00e1c do \u1ed1m \u0111au, b\u1ec7nh t\u1eadt, thai s\u1ea3n"
  94.         },
  95.         "age_groups_premium": {
  96.             "2064": "2.550.000 ",
  97.             "2059": "600.000",
  98.             "2060": "270.000 "
  99.         },
  100.         "name": "Ch\u01b0\u01a1ng tr\u00ecnh 2 ",
  101.         "treatment_area": "Vi\u1ec7t Nam "
  102.     },
  103.     {
  104.         "currency": "VND",
  105.         "medical_services_limit": {
  106.             "2944": "",
  107.             "2947": " 300.000.000 VN\u0110",
  108.             "2948": " 15.000.000 VN\u0110",
  109.             "2949": "T\u1ed1i \u0111a \u0111\u1ebfn s\u1ed1 ti\u1ec1n b\u1ea3o hi\u1ec3m",
  110.             "2950": "T\u1ed1i \u0111a \u0111\u1ebfn s\u1ed1 ti\u1ec1n b\u1ea3o hi\u1ec3m",
  111.             "2951": "",
  112.             "2952": " 15.000.000 VN\u0110",
  113.             "2953": " 15.000.000 VN\u0110",
  114.             "2954": " 15.000.000 VN\u0110",
  115.             "2955": "T\u1ed1i \u0111a \u0111\u1ebfn s\u1ed1 ti\u1ec1n b\u1ea3o hi\u1ec3m",
  116.             "2956": "30.000.000 VN\u0110",
  117.             "2957": "T\u1ed1i \u0111a \u0111\u1ebfn s\u1ed1 ti\u1ec1n b\u1ea3o hi\u1ec3m",
  118.             "2958": "300.000 VN\u0110",
  119.             "2959": "2.000.000 VN\u0110",
  120.             "2960": ""
  121.         }
  122.     }
  123. ]
  124.  
  125.  
  126. from appdirs import unicode
  127.  
  128. fo = open("data.json", "w", encoding="utf8")
  129. for obj in arr:
  130.     for key, val in obj["medical_services_limit"].items():
  131.         val = str.encode(val).decode('utf8')
  132.    
  133. import json
  134. json.dump({"arr": arr}, fo, ensure_ascii=False)
  135. fo.flush()
  136. fo.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement