convert icon indicating copy to clipboard operation
convert copied to clipboard

Update the ISO-8859 encodings to match the current standards

Open brianquinlan opened this issue 2 years ago • 0 comments

  • Update the ISO-8859-* encodings to match the current standards at https://unicode.org/Public/MAPPINGS

I generated the mappings using this script:

import unicodedata

top_controls = (r'\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c'
    r'\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e'
    r'\x9f\xa0')

def get_char_mapping(encoding, r=None):
    s = ""
    if r is None:
        r = range(256)
    for i in r:
        try:
            ch = bytes([i]).decode(encoding)
        except UnicodeDecodeError:
            s += '\\ufffd'
        else:
            if ord(ch) > 0xffff:
                raise ValueError('not in BMP')
            if unicodedata.category(ch).startswith('C') or unicodedata.category(ch).startswith('Z'):
                if ord(ch) < 256:
                    s += f'\\x{ord(ch):02x}'
                else:
                    s += f'\\u{ord(ch):04x}'
            else:
                s += ch
    return s

char_map = get_char_mapping('iso8859-3', range(128, 256))
print(char_map.replace(top_controls, '$_topIsoControls'))

  • [X] I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:

Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.

brianquinlan avatar Nov 06 '23 17:11 brianquinlan