Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/python/pip/pip/_vendor/chardet/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 29 kB image not shown  

Quelle  mbcssm.py

  Sprache: Python
 

######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#   Mark Pilgrim - port to Python
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301  USA
######################### END LICENSE BLOCK #########################

from .codingstatemachinedict import CodingStateMachineDict
from .enums import MachineState

# BIG5

# fmt: off
BIG5_CLS = (
    11111111,  # 00 - 07    #allow 0x00 as legal value
    11111100,  # 08 - 0f
    11111111,  # 10 - 17
    11101111,  # 18 - 1f
    11111111,  # 20 - 27
    11111111,  # 28 - 2f
    11111111,  # 30 - 37
    11111111,  # 38 - 3f
    22222222,  # 40 - 47
    22222222,  # 48 - 4f
    22222222,  # 50 - 57
    22222222,  # 58 - 5f
    22222222,  # 60 - 67
    22222222,  # 68 - 6f
    22222222,  # 70 - 77
    22222221,  # 78 - 7f
    44444444,  # 80 - 87
    44444444,  # 88 - 8f
    44444444,  # 90 - 97
    44444444,  # 98 - 9f
    43333333,  # a0 - a7
    33333333,  # a8 - af
    33333333,  # b0 - b7
    33333333,  # b8 - bf
    33333333,  # c0 - c7
    33333333,  # c8 - cf
    33333333,  # d0 - d7
    33333333,  # d8 - df
    33333333,  # e0 - e7
    33333333,  # e8 - ef
    33333333,  # f0 - f7
    33333330  # f8 - ff
)

BIG5_ST = (
    MachineState.ERROR,MachineState.START,MachineState.START,     3,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#00-07
    MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,#08-0f
    MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START#10-17
)
# fmt: on

BIG5_CHAR_LEN_TABLE = (01120)

BIG5_SM_MODEL: CodingStateMachineDict = {
    "class_table": BIG5_CLS,
    "class_factor"5,
    "state_table": BIG5_ST,
    "char_len_table": BIG5_CHAR_LEN_TABLE,
    "name""Big5",
}

# CP949
# fmt: off
CP949_CLS  = (
    1111111111111100,  # 00 - 0f
    1111111111101111,  # 10 - 1f
    1111111111111111,  # 20 - 2f
    1111111111111111,  # 30 - 3f
    1444444444444444,  # 40 - 4f
    4455555555511111,  # 50 - 5f
    1555555555555555,  # 60 - 6f
    5555555555511111,  # 70 - 7f
    0666666666666666,  # 80 - 8f
    6666666666666666,  # 90 - 9f
    6777777777777888,  # a0 - af
    7777777777777777,  # b0 - bf
    7777779223222222,  # c0 - cf
    2222222222222222,  # d0 - df
    2222222222222222,  # e0 - ef
    2222222222222220,  # f0 - ff
)

CP949_ST = (
#cls=    0      1      2      3      4      5      6      7      8      9  # previous state =
    MachineState.ERROR,MachineState.START,     3,MachineState.ERROR,MachineState.START,MachineState.START,     4,     5,MachineState.ERROR,     6# MachineState.START
    MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, # MachineState.ERROR
    MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME, # MachineState.ITS_ME
    MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START, # 3
    MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START, # 4
    MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START, # 5
    MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START, # 6
)
# fmt: on

CP949_CHAR_LEN_TABLE = (0120112202)

CP949_SM_MODEL: CodingStateMachineDict = {
    "class_table": CP949_CLS,
    "class_factor"10,
    "state_table": CP949_ST,
    "char_len_table": CP949_CHAR_LEN_TABLE,
    "name""CP949",
}

# EUC-JP
# fmt: off
EUCJP_CLS = (
    44444444,  # 00 - 07
    44444455,  # 08 - 0f
    44444444,  # 10 - 17
    44454444,  # 18 - 1f
    44444444,  # 20 - 27
    44444444,  # 28 - 2f
    44444444,  # 30 - 37
    44444444,  # 38 - 3f
    44444444,  # 40 - 47
    44444444,  # 48 - 4f
    44444444,  # 50 - 57
    44444444,  # 58 - 5f
    44444444,  # 60 - 67
    44444444,  # 68 - 6f
    44444444,  # 70 - 77
    44444444,  # 78 - 7f
    55555555,  # 80 - 87
    55555513,  # 88 - 8f
    55555555,  # 90 - 97
    55555555,  # 98 - 9f
    52222222,  # a0 - a7
    22222222,  # a8 - af
    22222222,  # b0 - b7
    22222222,  # b8 - bf
    22222222,  # c0 - c7
    22222222,  # c8 - cf
    22222222,  # d0 - d7
    22222222,  # d8 - df
    00000000,  # e0 - e7
    00000000,  # e8 - ef
    00000000,  # f0 - f7
    00000005  # f8 - ff
)

EUCJP_ST = (
          3,     4,     3,     5,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#00-07
     MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f
     MachineState.ITS_ME,MachineState.ITS_ME,MachineState.START,MachineState.ERROR,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#10-17
     MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,     3,MachineState.ERROR,#18-1f
          3,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START#20-27
)
# fmt: on

EUCJP_CHAR_LEN_TABLE = (222310)

EUCJP_SM_MODEL: CodingStateMachineDict = {
    "class_table": EUCJP_CLS,
    "class_factor"6,
    "state_table": EUCJP_ST,
    "char_len_table": EUCJP_CHAR_LEN_TABLE,
    "name""EUC-JP",
}

# EUC-KR
# fmt: off
EUCKR_CLS  = (
    11111111,  # 00 - 07
    11111100,  # 08 - 0f
    11111111,  # 10 - 17
    11101111,  # 18 - 1f
    11111111,  # 20 - 27
    11111111,  # 28 - 2f
    11111111,  # 30 - 37
    11111111,  # 38 - 3f
    11111111,  # 40 - 47
    11111111,  # 48 - 4f
    11111111,  # 50 - 57
    11111111,  # 58 - 5f
    11111111,  # 60 - 67
    11111111,  # 68 - 6f
    11111111,  # 70 - 77
    11111111,  # 78 - 7f
    00000000,  # 80 - 87
    00000000,  # 88 - 8f
    00000000,  # 90 - 97
    00000000,  # 98 - 9f
    02222222,  # a0 - a7
    22222333,  # a8 - af
    22222222,  # b0 - b7
    22222222,  # b8 - bf
    22222222,  # c0 - c7
    23222222,  # c8 - cf
    22222222,  # d0 - d7
    22222222,  # d8 - df
    22222222,  # e0 - e7
    22222222,  # e8 - ef
    22222222,  # f0 - f7
    22222220   # f8 - ff
)

EUCKR_ST = (
    MachineState.ERROR,MachineState.START,     3,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#00-07
    MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START #08-0f
)
# fmt: on

EUCKR_CHAR_LEN_TABLE = (0120)

EUCKR_SM_MODEL: CodingStateMachineDict = {
    "class_table": EUCKR_CLS,
    "class_factor"4,
    "state_table": EUCKR_ST,
    "char_len_table": EUCKR_CHAR_LEN_TABLE,
    "name""EUC-KR",
}

# JOHAB
# fmt: off
JOHAB_CLS = (
    4,4,4,4,4,4,4,4,  # 00 - 07
    4,4,4,4,4,4,0,0,  # 08 - 0f
    4,4,4,4,4,4,4,4,  # 10 - 17
    4,4,4,0,4,4,4,4,  # 18 - 1f
    4,4,4,4,4,4,4,4,  # 20 - 27
    4,4,4,4,4,4,4,4,  # 28 - 2f
    4,3,3,3,3,3,3,3,  # 30 - 37
    3,3,3,3,3,3,3,3,  # 38 - 3f
    3,1,1,1,1,1,1,1,  # 40 - 47
    1,1,1,1,1,1,1,1,  # 48 - 4f
    1,1,1,1,1,1,1,1,  # 50 - 57
    1,1,1,1,1,1,1,1,  # 58 - 5f
    1,1,1,1,1,1,1,1,  # 60 - 67
    1,1,1,1,1,1,1,1,  # 68 - 6f
    1,1,1,1,1,1,1,1,  # 70 - 77
    1,1,1,1,1,1,1,2,  # 78 - 7f
    6,6,6,6,8,8,8,8,  # 80 - 87
    8,8,8,8,8,8,8,8,  # 88 - 8f
    8,7,7,7,7,7,7,7,  # 90 - 97
    7,7,7,7,7,7,7,7,  # 98 - 9f
    7,7,7,7,7,7,7,7,  # a0 - a7
    7,7,7,7,7,7,7,7,  # a8 - af
    7,7,7,7,7,7,7,7,  # b0 - b7
    7,7,7,7,7,7,7,7,  # b8 - bf
    7,7,7,7,7,7,7,7,  # c0 - c7
    7,7,7,7,7,7,7,7,  # c8 - cf
    7,7,7,7,5,5,5,5,  # d0 - d7
    5,9,9,9,9,9,9,5,  # d8 - df
    9,9,9,9,9,9,9,9,  # e0 - e7
    9,9,9,9,9,9,9,9,  # e8 - ef
    9,9,9,9,9,9,9,9,  # f0 - f7
    9,9,5,5,5,5,5,0   # f8 - ff
)

JOHAB_ST = (
# cls = 0                   1                   2                   3                   4                   5                   6                   7                   8                   9
    MachineState.ERROR ,MachineState.START ,MachineState.START ,MachineState.START ,MachineState.START ,MachineState.ERROR ,MachineState.ERROR ,3                  ,3                  ,4                  ,  # MachineState.START
    MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,  # MachineState.ITS_ME
    MachineState.ERROR ,MachineState.ERROR ,MachineState.ERROR ,MachineState.ERROR ,MachineState.ERROR ,MachineState.ERROR ,MachineState.ERROR ,MachineState.ERROR ,MachineState.ERROR ,MachineState.ERROR ,  # MachineState.ERROR
    MachineState.ERROR ,MachineState.START ,MachineState.START ,MachineState.ERROR ,MachineState.ERROR ,MachineState.START ,MachineState.START ,MachineState.START ,MachineState.START ,MachineState.START ,  # 3
    MachineState.ERROR ,MachineState.START ,MachineState.ERROR ,MachineState.START ,MachineState.ERROR ,MachineState.START ,MachineState.ERROR ,MachineState.START ,MachineState.ERROR ,MachineState.START ,  # 4
)
# fmt: on

JOHAB_CHAR_LEN_TABLE = (0111100222)

JOHAB_SM_MODEL: CodingStateMachineDict = {
    "class_table": JOHAB_CLS,
    "class_factor"10,
    "state_table": JOHAB_ST,
    "char_len_table": JOHAB_CHAR_LEN_TABLE,
    "name""Johab",
}

# EUC-TW
# fmt: off
EUCTW_CLS = (
    22222222,  # 00 - 07
    22222200,  # 08 - 0f
    22222222,  # 10 - 17
    22202222,  # 18 - 1f
    22222222,  # 20 - 27
    22222222,  # 28 - 2f
    22222222,  # 30 - 37
    22222222,  # 38 - 3f
    22222222,  # 40 - 47
    22222222,  # 48 - 4f
    22222222,  # 50 - 57
    22222222,  # 58 - 5f
    22222222,  # 60 - 67
    22222222,  # 68 - 6f
    22222222,  # 70 - 77
    22222222,  # 78 - 7f
    00000000,  # 80 - 87
    00000060,  # 88 - 8f
    00000000,  # 90 - 97
    00000000,  # 98 - 9f
    03444444,  # a0 - a7
    55111111,  # a8 - af
    11111111,  # b0 - b7
    11111111,  # b8 - bf
    11313333,  # c0 - c7
    33333333,  # c8 - cf
    33333333,  # d0 - d7
    33333333,  # d8 - df
    33333333,  # e0 - e7
    33333333,  # e8 - ef
    33333333,  # f0 - f7
    33333330   # f8 - ff
)

EUCTW_ST = (
    MachineState.ERROR,MachineState.ERROR,MachineState.START,     3,     3,     3,     4,MachineState.ERROR,#00-07
    MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f
    MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.START,MachineState.ERROR,#10-17
    MachineState.START,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#18-1f
         5,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.ERROR,MachineState.START,MachineState.START,#20-27
    MachineState.START,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START #28-2f
)
# fmt: on

EUCTW_CHAR_LEN_TABLE = (0012223)

EUCTW_SM_MODEL: CodingStateMachineDict = {
    "class_table": EUCTW_CLS,
    "class_factor"7,
    "state_table": EUCTW_ST,
    "char_len_table": EUCTW_CHAR_LEN_TABLE,
    "name""x-euc-tw",
}

# GB2312
# fmt: off
GB2312_CLS = (
    11111111,  # 00 - 07
    11111100,  # 08 - 0f
    11111111,  # 10 - 17
    11101111,  # 18 - 1f
    11111111,  # 20 - 27
    11111111,  # 28 - 2f
    33333333,  # 30 - 37
    33111111,  # 38 - 3f
    22222222,  # 40 - 47
    22222222,  # 48 - 4f
    22222222,  # 50 - 57
    22222222,  # 58 - 5f
    22222222,  # 60 - 67
    22222222,  # 68 - 6f
    22222222,  # 70 - 77
    22222224,  # 78 - 7f
    56666666,  # 80 - 87
    66666666,  # 88 - 8f
    66666666,  # 90 - 97
    66666666,  # 98 - 9f
    66666666,  # a0 - a7
    66666666,  # a8 - af
    66666666,  # b0 - b7
    66666666,  # b8 - bf
    66666666,  # c0 - c7
    66666666,  # c8 - cf
    66666666,  # d0 - d7
    66666666,  # d8 - df
    66666666,  # e0 - e7
    66666666,  # e8 - ef
    66666666,  # f0 - f7
    66666660   # f8 - ff
)

GB2312_ST = (
    MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,     3,MachineState.ERROR,#00-07
    MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f
    MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.START,#10-17
         4,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#18-1f
    MachineState.ERROR,MachineState.ERROR,     5,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,#20-27
    MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START #28-2f
)
# fmt: on

# To be accurate, the length of class 6 can be either 2 or 4.
# But it is not necessary to discriminate between the two since
# it is used for frequency analysis only, and we are validating
# each code range there as well. So it is safe to set it to be
# 2 here.
GB2312_CHAR_LEN_TABLE = (0111112)

GB2312_SM_MODEL: CodingStateMachineDict = {
    "class_table": GB2312_CLS,
    "class_factor"7,
    "state_table": GB2312_ST,
    "char_len_table": GB2312_CHAR_LEN_TABLE,
    "name""GB2312",
}

# Shift_JIS
# fmt: off
SJIS_CLS = (
    11111111,  # 00 - 07
    11111100,  # 08 - 0f
    11111111,  # 10 - 17
    11101111,  # 18 - 1f
    11111111,  # 20 - 27
    11111111,  # 28 - 2f
    11111111,  # 30 - 37
    11111111,  # 38 - 3f
    22222222,  # 40 - 47
    22222222,  # 48 - 4f
    22222222,  # 50 - 57
    22222222,  # 58 - 5f
    22222222,  # 60 - 67
    22222222,  # 68 - 6f
    22222222,  # 70 - 77
    22222221,  # 78 - 7f
    33333223,  # 80 - 87
    33333333,  # 88 - 8f
    33333333,  # 90 - 97
    33333333,  # 98 - 9f
    #0xa0 is illegal in sjis encoding, but some pages does
    #contain such byte. We need to be more error forgiven.
    22222222,  # a0 - a7
    22222222,  # a8 - af
    22222222,  # b0 - b7
    22222222,  # b8 - bf
    22222222,  # c0 - c7
    22222222,  # c8 - cf
    22222222,  # d0 - d7
    22222222,  # d8 - df
    33333333,  # e0 - e7
    33333444,  # e8 - ef
    33333333,  # f0 - f7
    33333000,  # f8 - ff
)

SJIS_ST = (
    MachineState.ERROR,MachineState.START,MachineState.START,     3,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#00-07
    MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f
    MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START #10-17
)
# fmt: on

SJIS_CHAR_LEN_TABLE = (011200)

SJIS_SM_MODEL: CodingStateMachineDict = {
    "class_table": SJIS_CLS,
    "class_factor"6,
    "state_table": SJIS_ST,
    "char_len_table": SJIS_CHAR_LEN_TABLE,
    "name""Shift_JIS",
}

# UCS2-BE
# fmt: off
UCS2BE_CLS = (
    00000000,  # 00 - 07
    00100200,  # 08 - 0f
    00000000,  # 10 - 17
    00030000,  # 18 - 1f
    00000000,  # 20 - 27
    03333300,  # 28 - 2f
    00000000,  # 30 - 37
    00000000,  # 38 - 3f
    00000000,  # 40 - 47
    00000000,  # 48 - 4f
    00000000,  # 50 - 57
    00000000,  # 58 - 5f
    00000000,  # 60 - 67
    00000000,  # 68 - 6f
    00000000,  # 70 - 77
    00000000,  # 78 - 7f
    00000000,  # 80 - 87
    00000000,  # 88 - 8f
    00000000,  # 90 - 97
    00000000,  # 98 - 9f
    00000000,  # a0 - a7
    00000000,  # a8 - af
    00000000,  # b0 - b7
    00000000,  # b8 - bf
    00000000,  # c0 - c7
    00000000,  # c8 - cf
    00000000,  # d0 - d7
    00000000,  # d8 - df
    00000000,  # e0 - e7
    00000000,  # e8 - ef
    00000000,  # f0 - f7
    00000045   # f8 - ff
)

UCS2BE_ST  = (
          5,     7,     7,MachineState.ERROR,     4,     3,MachineState.ERROR,MachineState.ERROR,#00-07
     MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f
     MachineState.ITS_ME,MachineState.ITS_ME,     6,     6,     6,     6,MachineState.ERROR,MachineState.ERROR,#10-17
          6,     6,     6,     6,     6,MachineState.ITS_ME,     6,     6,#18-1f
          6,     6,     6,     6,     5,     7,     7,MachineState.ERROR,#20-27
          5,     8,     6,     6,MachineState.ERROR,     6,     6,     6,#28-2f
          6,     6,     6,     6,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START #30-37
)
# fmt: on

UCS2BE_CHAR_LEN_TABLE = (222022)

UCS2BE_SM_MODEL: CodingStateMachineDict = {
    "class_table": UCS2BE_CLS,
    "class_factor"6,
    "state_table": UCS2BE_ST,
    "char_len_table": UCS2BE_CHAR_LEN_TABLE,
    "name""UTF-16BE",
}

# UCS2-LE
# fmt: off
UCS2LE_CLS = (
    00000000,  # 00 - 07
    00100200,  # 08 - 0f
    00000000,  # 10 - 17
    00030000,  # 18 - 1f
    00000000,  # 20 - 27
    03333300,  # 28 - 2f
    00000000,  # 30 - 37
    00000000,  # 38 - 3f
    00000000,  # 40 - 47
    00000000,  # 48 - 4f
    00000000,  # 50 - 57
    00000000,  # 58 - 5f
    00000000,  # 60 - 67
    00000000,  # 68 - 6f
    00000000,  # 70 - 77
    00000000,  # 78 - 7f
    00000000,  # 80 - 87
    00000000,  # 88 - 8f
    00000000,  # 90 - 97
    00000000,  # 98 - 9f
    00000000,  # a0 - a7
    00000000,  # a8 - af
    00000000,  # b0 - b7
    00000000,  # b8 - bf
    00000000,  # c0 - c7
    00000000,  # c8 - cf
    00000000,  # d0 - d7
    00000000,  # d8 - df
    00000000,  # e0 - e7
    00000000,  # e8 - ef
    00000000,  # f0 - f7
    00000045   # f8 - ff
)

UCS2LE_ST = (
          6,     6,     7,     6,     4,     3,MachineState.ERROR,MachineState.ERROR,#00-07
     MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f
     MachineState.ITS_ME,MachineState.ITS_ME,     5,     5,     5,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,#10-17
          5,     5,     5,MachineState.ERROR,     5,MachineState.ERROR,     6,     6,#18-1f
          7,     6,     8,     8,     5,     5,     5,MachineState.ERROR,#20-27
          5,     5,     5,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,     5,     5,#28-2f
          5,     5,     5,MachineState.ERROR,     5,MachineState.ERROR,MachineState.START,MachineState.START #30-37
)
# fmt: on

UCS2LE_CHAR_LEN_TABLE = (222222)

UCS2LE_SM_MODEL: CodingStateMachineDict = {
    "class_table": UCS2LE_CLS,
    "class_factor"6,
    "state_table": UCS2LE_ST,
    "char_len_table": UCS2LE_CHAR_LEN_TABLE,
    "name""UTF-16LE",
}

# UTF-8
# fmt: off
UTF8_CLS = (
    11111111,  # 00 - 07  #allow 0x00 as a legal value
    11111100,  # 08 - 0f
    11111111,  # 10 - 17
    11101111,  # 18 - 1f
    11111111,  # 20 - 27
    11111111,  # 28 - 2f
    11111111,  # 30 - 37
    11111111,  # 38 - 3f
    11111111,  # 40 - 47
    11111111,  # 48 - 4f
    11111111,  # 50 - 57
    11111111,  # 58 - 5f
    11111111,  # 60 - 67
    11111111,  # 68 - 6f
    11111111,  # 70 - 77
    11111111,  # 78 - 7f
    22223333,  # 80 - 87
    44444444,  # 88 - 8f
    44444444,  # 90 - 97
    44444444,  # 98 - 9f
    55555555,  # a0 - a7
    55555555,  # a8 - af
    55555555,  # b0 - b7
    55555555,  # b8 - bf
    00666666,  # c0 - c7
    66666666,  # c8 - cf
    66666666,  # d0 - d7
    66666666,  # d8 - df
    78888888,  # e0 - e7
    88888988,  # e8 - ef
    1011111111111111,  # f0 - f7
    12131313141500    # f8 - ff
)

UTF8_ST = (
    MachineState.ERROR,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,     12,   10,#00-07
         9,     11,     8,     7,     6,     5,     4,    3,#08-0f
    MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#10-17
    MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#18-1f
    MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#20-27
    MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#28-2f
    MachineState.ERROR,MachineState.ERROR,     5,     5,     5,     5,MachineState.ERROR,MachineState.ERROR,#30-37
    MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#38-3f
    MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,     5,     5,     5,MachineState.ERROR,MachineState.ERROR,#40-47
    MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#48-4f
    MachineState.ERROR,MachineState.ERROR,     7,     7,     7,     7,MachineState.ERROR,MachineState.ERROR,#50-57
    MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#58-5f
    MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,     7,     7,MachineState.ERROR,MachineState.ERROR,#60-67
    MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#68-6f
    MachineState.ERROR,MachineState.ERROR,     9,     9,     9,     9,MachineState.ERROR,MachineState.ERROR,#70-77
    MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#78-7f
    MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,     9,MachineState.ERROR,MachineState.ERROR,#80-87
    MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#88-8f
    MachineState.ERROR,MachineState.ERROR,    12,    12,    12,    12,MachineState.ERROR,MachineState.ERROR,#90-97
    MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#98-9f
    MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,    12,MachineState.ERROR,MachineState.ERROR,#a0-a7
    MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#a8-af
    MachineState.ERROR,MachineState.ERROR,    12,    12,    12,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#b0-b7
    MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#b8-bf
    MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,#c0-c7
    MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR #c8-cf
)
# fmt: on

UTF8_CHAR_LEN_TABLE = (0100002333445566)

UTF8_SM_MODEL: CodingStateMachineDict = {
    "class_table": UTF8_CLS,
    "class_factor"16,
    "state_table": UTF8_ST,
    "char_len_table": UTF8_CHAR_LEN_TABLE,
    "name""UTF-8",
}

Messung V0.5 in Prozent
C=90 H=82 G=86

¤ Dauer der Verarbeitung: 0.20 Sekunden  (vorverarbeitet am  2026-06-05) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.