ui.json에 문자열이 추가되는경우
내가 사용하던 ui.json에 추가된부분만 갖다붙여넣기

# -*- coding: utf-8 -*-
"""
Created on Wed Oct 27 17:51:17 2021

@author: circi
"""
import json

#내가쓰던거
path_myUi = r"datamy_ui.json"
#새로운 버전
path_D2R_patch = r"dataui_patched.json"
#출력될곳
path_export = r"dataui_export.json"

data1 = []
data2 = []
data1idList = []

with open(path_myUi, encoding="UTF-8-sig") as f_org:
    data1 = json.load(f_org)
    for datas in data1:
        data1idList.append(datas.get("id"))
 
with open(path_D2R_patch, encoding="UTF-8-sig") as f_org:
    data2 = json.load(f_org)
    
for index, datas in enumerate(data2):
    data_id = datas.get("id")
    if not data_id in data1idList:
        print(index, "-",  data_id, "-", datas.get("koKR"))
        data1.append(data2[index])
        
with open(path_export, 'w', encoding="UTF-8-sig") as f_org:
    #json.dump(data2, f_org, indent = 2, ensure_ascii = False)
    f_org.write('[n')
    for datas in data1:
        f_org.write('  {n')
        for key, value in datas.items():
            if type(value) is str:
                value = value.replace('n','\n')
                value = value.replace('"','\"')
                value = value.replace('uE01D','\uE01D')
            if key == 'id':
                f_org.write('    "%s": %s,n' % (key, value))
            elif key == list(datas)[-1]:
                f_org.write('    "%s": "%s"n' % (key, value))
            else:
                f_org.write('    "%s": "%s",n' % (key, value))
                
        if datas is data1[-1]:
            f_org.write('  }n')
        else:
            f_org.write('  },n')
    f_org.write(']')


원래는 json.dump로 하면 되는데 uE01D 이 유니코드 처리되는문제 때문에 고민하다가 답이안나와서 한줄한줄 출력하는걸로..
혹시나 좋은방법 있으신분좀 알려주세요 :(