youngchan1988 / json_editor

A json editor on flutter
BSD 3-Clause "New" or "Revised" License
22 stars 21 forks source link

(Feature Request) Add the support for khmer language #4

Closed itsatifsiddiqui closed 2 years ago

itsatifsiddiqui commented 2 years ago

Thank you for the great package. It works perfectly fine when dealing with the English language.

It would be great if you can take some time from your busy schedule to add support for this feature. Or you can point me to some direction so I can implement it myself and create a pull request.

When JSON contains the Khmer language it doesn't parse and format the string. I looked into the code and found out that the package only deals with English Unicode only. It would be great if you can add the language support for Khmer as well so it parses and formats the Khmer language just like it does with English.

See the attached examples.

Example 1: At the end inside verb it ends with double closing curly bracket } whereas there should be only one. Also when editing the closing curly bracket } after def key value, it can't be deleted. Screen Shot 2022-03-23 at 5 47 39 PM

Here is the JSON so you can test it. { "uid": "61ea4987851f4038c8fcfb26", "hw": "put a stop to", "syllable": [ { "syl": "put a stop to" } ], "fl": "v.", "verb": [ { "def": "ដាក់ការបញ្ឈប់ទៅ។ " } ], }

Example 2: In this example, there should be a closing square bracket and a closing curly bracket. But there is not and the editor is not throwing any error. Screen Shot 2022-03-23 at 5 52 01 PM

Here is the JSON so you can test it. { "uid": "61ea4987851f4038c8fcfb23", "hw": "put a flea in one's ear", "syllable": [ { "syl": "put a flea in one's ear" } ], "fl": "v.", "verb": [ { "def": "ផ្លុំត្រចៀក; និយាយរញ៉ាំរញ៉ូវ; ទន្ទេញទន្ទូររឿយៗ។ " } ], }

Here is the Unicode specification for Khmer language

https://unicode.org/charts/PDF/U1780.pdf

Sharing what I searched and found

I want to support the Khmer characters listed in the table below CHARACTER TO UNICODE, CONVERSIONS I think you'll be mostly interested in Decimal values, as this is what you're using for english.

Character Decimal Value U+HEX UTF-16 code units
6016 U+1780 1780
6017 U+1781 1781
6018 U+1782 1782
6019 U+1783 1783
6020 U+1784 1784
6021 U+1785 1785
6022 U+1786 1786
6023 U+1787 1787
6024 U+1788 1788
6025 U+1789 1789
6026 U+178A 178A
6027 U+178B 178B
6028 U+178C 178C
6029 U+178D 178D
6030 U+178E 178E
6031 U+178F 178F
6032 U+1790 1790
6033 U+1791 1791
6034 U+1792 1792
6035 U+1793 1793
6036 U+1794 1794
6037 U+1795 1795
6038 U+1796 1796
6039 U+1797 1797
6040 U+1798 1798
6041 U+1799 1799
6042 U+179A 179A
6043 U+179B 179B
6044 U+179C 179C
6045 U+179D 179D
6046 U+179E 179E
6047 U+179F 179F
6048 U+17A0 17A0
6049 U+17A1 17A1
6050 U+17A2 17A2
6051 U+17A3 17A3
6052 U+17A4 17A4
6053 U+17A5 17A5
6054 U+17A6 17A6
6055 U+17A7 17A7
6056 U+17A8 17A8
6057 U+17A9 17A9
6058 U+17AA 17AA
6059 U+17AB 17AB
6060 U+17AC 17AC
6061 U+17AD 17AD
6062 U+17AE 17AE
6063 U+17AF 17AF
6064 U+17B0 17B0
6065 U+17B1 17B1
6066 U+17B2 17B2
6067 U+17B3 17B3
6068 U+17B4 17B4
6069 U+17B5 17B5
6070 U+17B6 17B6
6071 U+17B7 17B7
6072 U+17B8 17B8
6073 U+17B9 17B9
6074 U+17BA 17BA
6075 U+17BB 17BB
6076 U+17BC 17BC
6077 U+17BD 17BD
6078 U+17BE 17BE
6079 U+17BF 17BF
6080 U+17C0 17C0
6081 U+17C1 17C1
6082 U+17C2 17C2
6083 U+17C3 17C3
6084 U+17C4 17C4
6085 U+17C5 17C5
6086 U+17C6 17C6
6087 U+17C7 17C7
6088 U+17C8 17C8
6089 U+17C9 17C9
6090 U+17CA 17CA
6091 U+17CB 17CB
6092 U+17CC 17CC
6093 U+17CD 17CD
6094 U+17CE 17CE
6095 U+17CF 17CF
6096 U+17D0 17D0
6097 U+17D1 17D1
6098 U+17D2 17D2
6099 U+17D3 17D3
6100 U+17D4 17D4
6101 U+17D5 17D5
6102 U+17D6 17D6
6103 U+17D7 17D7
6104 U+17D8 17D8
6105 U+17D9 17D9
6106 U+17DA 17DA
6107 U+17DB 17DB
6108 U+17DC 17DC
6109 U+17DD 17DD
6112 U+17E0 17E0
6113 U+17E1 17E1
6114 U+17E2 17E2
6115 U+17E3 17E3
6116 U+17E4 17E4
6117 U+17E5 17E5
6118 U+17E6 17E6
6119 U+17E7 17E7
6120 U+17E8 17E8
6121 U+17E9 17E9
6128 U+17F0 17F0
6129 U+17F1 17F1
6130 U+17F2 17F2
6131 U+17F3 17F3
6132 U+17F4 17F4
6133 U+17F5 17F5
6134 U+17F6 17F6
6135 U+17F7 17F7
6136 U+17F8 17F8
6137 U+17F9 17F9
youngchan1988 commented 2 years ago

Fixed in 0.0.5. Have fun! :-)

itsatifsiddiqui commented 2 years ago

Fixed in 0.0.5. Have fun! :-)

Thank you so much. I will check.