def test_scc_special_character_values(self):
        special_char_codes = list(range(0x1130, 0x1140)) + list(
            range(0x1930, 0x1940))

        extended_char_codes = list(range(0x1220, 0x1240)) + list(range(0x1320, 0x1340)) + \
                              list(range(0x1A20, 0x1A40)) + list(range(0x1B20, 0x1B40))

        for code in special_char_codes:
            self.assertIsNotNone(SccSpecialCharacter.find(code))

        for code in extended_char_codes:
            self.assertIsNotNone(SccExtendedCharacter.find(code))
Exemplo n.º 2
0
    def process_line(self, line: SccLine) -> SmpteTimeCode:
        """Converts the SCC line to the data model"""

        debug = str(line.time_code) + "\t"

        for scc_word in line.scc_words:

            if self.previous_code == scc_word.value:
                continue

            line.time_code.add_frames()

            if scc_word.value == 0x0000:
                continue

            if scc_word.byte_1 < 0x20:

                control_code = SccControlCode.find(scc_word.value)
                if control_code is not None \
                    and control_code is SccControlCode.find(self.previous_code):
                    # Skip duplicated control code from 'Field 2'
                    line.time_code.add_frames(-1)
                    continue

                attribute_code = SccAttributeCode.find(scc_word.value)
                mid_row_code = SccMidRowCode.find(scc_word.value)
                pac = SccPreambleAddressCode.find(scc_word.byte_1,
                                                  scc_word.byte_2)
                spec_char = SccSpecialCharacter.find(scc_word.value)
                extended_char = SccExtendedCharacter.find(scc_word.value)

                if pac is not None:
                    debug += "[PAC|" + str(pac.get_row()) + "|" + str(
                        pac.get_indent())
                    if pac.get_color() is not None:
                        debug += "|" + str(pac.get_color())
                    if pac.get_font_style() is not None:
                        debug += "|I"
                    if pac.get_text_decoration() is not None:
                        debug += "|U"
                    debug += "/" + hex(scc_word.value) + "]"
                    self.process_preamble_address_code(pac, line.time_code)
                    self.previous_code_type = type(pac)

                elif attribute_code is not None:
                    debug += "[ATC/" + hex(scc_word.value) + "]"
                    self.process_attribute_code(attribute_code)
                    self.previous_code_type = type(attribute_code)

                elif mid_row_code is not None:
                    debug += "[MRC|" + mid_row_code.get_name() + "/" + hex(
                        scc_word.value) + "]"
                    self.process_mid_row_code(mid_row_code, line.time_code)
                    self.previous_code_type = type(mid_row_code)

                elif control_code is not None:
                    debug += "[CC|" + control_code.get_name() + "/" + hex(
                        scc_word.value) + "]"
                    self.process_control_code(control_code, line.time_code)
                    self.previous_code_type = type(control_code)

                elif spec_char is not None:
                    word = spec_char.get_unicode_value()
                    debug += word
                    self.process_text(word, line.time_code)
                    self.previous_code_type = type(spec_char)

                elif extended_char is not None:
                    if self.current_style in (SccCaptionStyle.PaintOn,
                                              SccCaptionStyle.RollUp):
                        self.active_caption.get_current_text().backspace()
                    else:
                        self.buffered_caption.get_current_text().backspace()

                    word = extended_char.get_unicode_value()
                    debug += word
                    self.process_text(word, line.time_code)
                    self.previous_code_type = type(extended_char)

                else:
                    debug += "[??/" + hex(scc_word.value) + "]"
                    LOGGER.warning("Unsupported SCC word: %s",
                                   hex(scc_word.value))
                    self.previous_code_type = None

            else:
                word = scc_word.to_text()
                debug += word
                self.process_text(word, line.time_code)
                self.previous_code_type = str

            self.previous_code = scc_word.value

        LOGGER.debug(debug)

        return line.time_code
Exemplo n.º 3
0
  def to_disassembly(self) -> str:
    """Converts SCC line into the disassembly format"""
    disassembly_line = str(self.time_code) + "\t"

    for scc_word in self.scc_words:

      if scc_word.value == 0x0000:
        disassembly_line += "{}"
        continue

      if scc_word.byte_1 < 0x20:

        attribute_code = SccAttributeCode.find(scc_word.value)
        control_code = SccControlCode.find(scc_word.value)
        mid_row_code = SccMidRowCode.find(scc_word.value)
        pac = SccPreambleAddressCode.find(scc_word.byte_1, scc_word.byte_2)
        spec_char = SccSpecialCharacter.find(scc_word.value)
        extended_char = SccExtendedCharacter.find(scc_word.value)

        if pac is not None:
          disassembly_line += f"{{{pac.get_row():02}"
          color = pac.get_color()
          indent = pac.get_indent()
          if indent is not None and indent > 0:
            disassembly_line += f"{indent :02}"
          elif color is not None:
            disassembly_line += get_color_disassembly(color)
            disassembly_line += get_font_style_disassembly(pac.get_font_style())
            disassembly_line += get_text_decoration_disassembly(pac.get_text_decoration())
          else:
            disassembly_line += "00"
          disassembly_line += "}"

        elif attribute_code is not None:
          disassembly_line += "{"
          disassembly_line += "B" if attribute_code.is_background() else ""
          disassembly_line += get_color_disassembly(attribute_code.get_color())
          disassembly_line += get_text_decoration_disassembly(attribute_code.get_text_decoration())
          disassembly_line += "}"

        elif mid_row_code is not None:
          disassembly_line += "{"
          disassembly_line += get_color_disassembly(mid_row_code.get_color())
          disassembly_line += get_font_style_disassembly(mid_row_code.get_font_style())
          disassembly_line += get_text_decoration_disassembly(mid_row_code.get_text_decoration())
          disassembly_line += "}"

        elif control_code is not None:
          disassembly_line += "{" + control_code.get_name() + "}"

        elif spec_char is not None:
          disassembly_line += spec_char.get_unicode_value()

        elif extended_char is not None:
          disassembly_line += extended_char.get_unicode_value()

        else:
          disassembly_line += "{??}"
          LOGGER.warning("Unsupported SCC word: %s", hex(scc_word.value))

      else:
        disassembly_line += scc_word.to_text()

    return disassembly_line
    def test_scc_danish_extended_characters_unicode_values(self):
        extended_char = SccExtendedCharacter.find(0x1338)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_A_WITH_RING_ABOVE,
            extended_char)
        self.assertEqual('\u00C5', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B38)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_A_WITH_RING_ABOVE,
            extended_char)
        self.assertEqual('\u00C5', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1339)
        self.assertEqual(
            SccExtendedCharacter.LATIN_SMALL_LETTER_A_WITH_RING_ABOVE,
            extended_char)
        self.assertEqual('\u00E5', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B39)
        self.assertEqual(
            SccExtendedCharacter.LATIN_SMALL_LETTER_A_WITH_RING_ABOVE,
            extended_char)
        self.assertEqual('\u00E5', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x133A)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_O_WITH_STROKE,
            extended_char)
        self.assertEqual('\u00D8', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B3A)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_O_WITH_STROKE,
            extended_char)
        self.assertEqual('\u00D8', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x133B)
        self.assertEqual(SccExtendedCharacter.LATIN_SMALL_LETTER_O_WITH_STROKE,
                         extended_char)
        self.assertEqual('\u00F8', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B3B)
        self.assertEqual(SccExtendedCharacter.LATIN_SMALL_LETTER_O_WITH_STROKE,
                         extended_char)
        self.assertEqual('\u00F8', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x133C)
        self.assertEqual(
            SccExtendedCharacter.BOX_DRAWINGS_HEAVY_DOWN_AND_RIGHT,
            extended_char)
        self.assertEqual('\u250F', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B3C)
        self.assertEqual(
            SccExtendedCharacter.BOX_DRAWINGS_HEAVY_DOWN_AND_RIGHT,
            extended_char)
        self.assertEqual('\u250F', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x133D)
        self.assertEqual(SccExtendedCharacter.BOX_DRAWINGS_HEAVY_DOWN_AND_LEFT,
                         extended_char)
        self.assertEqual('\u2513', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B3D)
        self.assertEqual(SccExtendedCharacter.BOX_DRAWINGS_HEAVY_DOWN_AND_LEFT,
                         extended_char)
        self.assertEqual('\u2513', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x133E)
        self.assertEqual(SccExtendedCharacter.BOX_DRAWINGS_HEAVY_UP_AND_RIGHT,
                         extended_char)
        self.assertEqual('\u2517', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B3E)
        self.assertEqual(SccExtendedCharacter.BOX_DRAWINGS_HEAVY_UP_AND_RIGHT,
                         extended_char)
        self.assertEqual('\u2517', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x133F)
        self.assertEqual(SccExtendedCharacter.BOX_DRAWINGS_HEAVY_UP_AND_LEFT,
                         extended_char)
        self.assertEqual('\u251B', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B3F)
        self.assertEqual(SccExtendedCharacter.BOX_DRAWINGS_HEAVY_UP_AND_LEFT,
                         extended_char)
        self.assertEqual('\u251B', extended_char.get_unicode_value())
    def test_scc_german_extended_characters_unicode_values(self):
        extended_char = SccExtendedCharacter.find(0x1330)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_A_WITH_DIAERESIS,
            extended_char)
        self.assertEqual('\u00C4', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B30)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_A_WITH_DIAERESIS,
            extended_char)
        self.assertEqual('\u00C4', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1331)
        self.assertEqual(
            SccExtendedCharacter.LATIN_SMALL_LETTER_A_WITH_DIAERESIS,
            extended_char)
        self.assertEqual('\u00E4', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B31)
        self.assertEqual(
            SccExtendedCharacter.LATIN_SMALL_LETTER_A_WITH_DIAERESIS,
            extended_char)
        self.assertEqual('\u00E4', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1332)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_O_WITH_DIAERESIS,
            extended_char)
        self.assertEqual('\u00D6', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B32)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_O_WITH_DIAERESIS,
            extended_char)
        self.assertEqual('\u00D6', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1333)
        self.assertEqual(
            SccExtendedCharacter.LATIN_SMALL_LETTER_O_WITH_DIAERESIS,
            extended_char)
        self.assertEqual('\u00F6', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B33)
        self.assertEqual(
            SccExtendedCharacter.LATIN_SMALL_LETTER_O_WITH_DIAERESIS,
            extended_char)
        self.assertEqual('\u00F6', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1334)
        self.assertEqual(SccExtendedCharacter.ESZETT, extended_char)
        self.assertEqual('\u00DF', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B34)
        self.assertEqual(SccExtendedCharacter.ESZETT, extended_char)
        self.assertEqual('\u00DF', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1335)
        self.assertEqual(SccExtendedCharacter.YEN_SIGN, extended_char)
        self.assertEqual('\u00A5', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B35)
        self.assertEqual(SccExtendedCharacter.YEN_SIGN, extended_char)
        self.assertEqual('\u00A5', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1336)
        self.assertEqual(SccExtendedCharacter.CURRENCY_SIGN, extended_char)
        self.assertEqual('\u00A4', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B36)
        self.assertEqual(SccExtendedCharacter.CURRENCY_SIGN, extended_char)
        self.assertEqual('\u00A4', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1337)
        self.assertEqual(SccExtendedCharacter.BOX_DRAWINGS_HEAVY_VERTICAL,
                         extended_char)
        self.assertEqual('\u2503', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B37)
        self.assertEqual(SccExtendedCharacter.BOX_DRAWINGS_HEAVY_VERTICAL,
                         extended_char)
        self.assertEqual('\u2503', extended_char.get_unicode_value())
    def test_scc_portuguese_extended_characters_unicode_values(self):
        extended_char = SccExtendedCharacter.find(0x1320)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_A_WITH_TILDE,
            extended_char)
        self.assertEqual('\u00C3', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B20)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_A_WITH_TILDE,
            extended_char)
        self.assertEqual('\u00C3', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1321)
        self.assertEqual(SccExtendedCharacter.LATIN_SMALL_LETTER_A_WITH_TILDE,
                         extended_char)
        self.assertEqual('\u00E3', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B21)
        self.assertEqual(SccExtendedCharacter.LATIN_SMALL_LETTER_A_WITH_TILDE,
                         extended_char)
        self.assertEqual('\u00E3', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1322)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_I_WITH_ACUTE,
            extended_char)
        self.assertEqual('\u00CD', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B22)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_I_WITH_ACUTE,
            extended_char)
        self.assertEqual('\u00CD', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1323)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_I_WITH_GRAVE,
            extended_char)
        self.assertEqual('\u00CC', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B23)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_I_WITH_GRAVE,
            extended_char)
        self.assertEqual('\u00CC', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1324)
        self.assertEqual(SccExtendedCharacter.LATIN_SMALL_LETTER_I_WITH_GRAVE,
                         extended_char)
        self.assertEqual('\u00EC', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B24)
        self.assertEqual(SccExtendedCharacter.LATIN_SMALL_LETTER_I_WITH_GRAVE,
                         extended_char)
        self.assertEqual('\u00EC', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1325)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_O_WITH_GRAVE,
            extended_char)
        self.assertEqual('\u00D2', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B25)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_O_WITH_GRAVE,
            extended_char)
        self.assertEqual('\u00D2', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1326)
        self.assertEqual(SccExtendedCharacter.LATIN_SMALL_LETTER_O_WITH_GRAVE,
                         extended_char)
        self.assertEqual('\u00F2', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B26)
        self.assertEqual(SccExtendedCharacter.LATIN_SMALL_LETTER_O_WITH_GRAVE,
                         extended_char)
        self.assertEqual('\u00F2', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1327)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_O_WITH_TILDE,
            extended_char)
        self.assertEqual('\u00D5', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B27)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_O_WITH_TILDE,
            extended_char)
        self.assertEqual('\u00D5', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1328)
        self.assertEqual(SccExtendedCharacter.LATIN_SMALL_LETTER_O_WITH_TILDE,
                         extended_char)
        self.assertEqual('\u00F5', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B28)
        self.assertEqual(SccExtendedCharacter.LATIN_SMALL_LETTER_O_WITH_TILDE,
                         extended_char)
        self.assertEqual('\u00F5', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1329)
        self.assertEqual(SccExtendedCharacter.BRACE_OPENING, extended_char)
        self.assertEqual('\u007B', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B29)
        self.assertEqual(SccExtendedCharacter.BRACE_OPENING, extended_char)
        self.assertEqual('\u007B', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x132A)
        self.assertEqual(SccExtendedCharacter.BRACE_CLOSING, extended_char)
        self.assertEqual('\u007D', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B2A)
        self.assertEqual(SccExtendedCharacter.BRACE_CLOSING, extended_char)
        self.assertEqual('\u007D', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x132B)
        self.assertEqual(SccExtendedCharacter.REVERSE_SOLIDUS, extended_char)
        self.assertEqual('\u005C', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B2B)
        self.assertEqual(SccExtendedCharacter.REVERSE_SOLIDUS, extended_char)
        self.assertEqual('\u005C', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x132C)
        self.assertEqual(SccExtendedCharacter.LATIN_SMALL_LETTER_TURNED_V,
                         extended_char)
        self.assertEqual('\u028C', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B2C)
        self.assertEqual(SccExtendedCharacter.LATIN_SMALL_LETTER_TURNED_V,
                         extended_char)
        self.assertEqual('\u028C', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x132D)
        self.assertEqual(SccExtendedCharacter.LOW_LINE, extended_char)
        self.assertEqual('\u005F', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B2D)
        self.assertEqual(SccExtendedCharacter.LOW_LINE, extended_char)
        self.assertEqual('\u005F', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x132E)
        self.assertEqual(SccExtendedCharacter.VERTICAL_LINE, extended_char)
        self.assertEqual('\u007C', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B2E)
        self.assertEqual(SccExtendedCharacter.VERTICAL_LINE, extended_char)
        self.assertEqual('\u007C', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x132F)
        self.assertEqual(SccExtendedCharacter.TILDE, extended_char)
        self.assertEqual('\u007E', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1B2F)
        self.assertEqual(SccExtendedCharacter.TILDE, extended_char)
        self.assertEqual('\u007E', extended_char.get_unicode_value())
    def test_scc_french_extended_characters_unicode_values(self):
        extended_char = SccExtendedCharacter.find(0x1230)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_A_WITH_GRAVE,
            extended_char)
        self.assertEqual('\u00C0', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A30)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_A_WITH_GRAVE,
            extended_char)
        self.assertEqual('\u00C0', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1231)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_A_WITH_CIRCUMFLEX,
            extended_char)
        self.assertEqual('\u00C2', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A31)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_A_WITH_CIRCUMFLEX,
            extended_char)
        self.assertEqual('\u00C2', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1232)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_C_WITH_CEDILLA,
            extended_char)
        self.assertEqual('\u00C7', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A32)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_C_WITH_CEDILLA,
            extended_char)
        self.assertEqual('\u00C7', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1233)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_E_WITH_GRAVE,
            extended_char)
        self.assertEqual('\u00C8', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A33)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_E_WITH_GRAVE,
            extended_char)
        self.assertEqual('\u00C8', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1234)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_E_WITH_CIRCUMFLEX,
            extended_char)
        self.assertEqual('\u00CA', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A34)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_E_WITH_CIRCUMFLEX,
            extended_char)
        self.assertEqual('\u00CA', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1235)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_E_WITH_DIAERESIS,
            extended_char)
        self.assertEqual('\u00CB', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A35)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_E_WITH_DIAERESIS,
            extended_char)
        self.assertEqual('\u00CB', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1236)
        self.assertEqual(
            SccExtendedCharacter.LATIN_SMALL_LETTER_E_WITH_DIAERESIS,
            extended_char)
        self.assertEqual('\u00EB', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A36)
        self.assertEqual(
            SccExtendedCharacter.LATIN_SMALL_LETTER_E_WITH_DIAERESIS,
            extended_char)
        self.assertEqual('\u00EB', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1237)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_I_WITH_CIRCUMFLEX,
            extended_char)
        self.assertEqual('\u00CE', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A37)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_I_WITH_CIRCUMFLEX,
            extended_char)
        self.assertEqual('\u00CE', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1238)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_I_WITH_DIAERESIS,
            extended_char)
        self.assertEqual('\u00CF', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A38)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_I_WITH_DIAERESIS,
            extended_char)
        self.assertEqual('\u00CF', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1239)
        self.assertEqual(
            SccExtendedCharacter.LATIN_SMALL_LETTER_I_WITH_DIAERESIS,
            extended_char)
        self.assertEqual('\u00EF', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A39)
        self.assertEqual(
            SccExtendedCharacter.LATIN_SMALL_LETTER_I_WITH_DIAERESIS,
            extended_char)
        self.assertEqual('\u00EF', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x123A)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_O_WITH_CIRCUMFLEX,
            extended_char)
        self.assertEqual('\u00D4', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A3A)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_O_WITH_CIRCUMFLEX,
            extended_char)
        self.assertEqual('\u00D4', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x123B)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_U_WITH_GRAVE,
            extended_char)
        self.assertEqual('\u00D9', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A3B)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_U_WITH_GRAVE,
            extended_char)
        self.assertEqual('\u00D9', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x123C)
        self.assertEqual(SccExtendedCharacter.LATIN_SMALL_LETTER_U_WITH_GRAVE,
                         extended_char)
        self.assertEqual('\u00F9', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A3C)
        self.assertEqual(SccExtendedCharacter.LATIN_SMALL_LETTER_U_WITH_GRAVE,
                         extended_char)
        self.assertEqual('\u00F9', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x123D)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_U_WITH_CIRCUMFLEX,
            extended_char)
        self.assertEqual('\u00DB', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A3D)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_U_WITH_CIRCUMFLEX,
            extended_char)
        self.assertEqual('\u00DB', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x123E)
        self.assertEqual(SccExtendedCharacter.LEFT_POINTING_GUILLEMET,
                         extended_char)
        self.assertEqual('\u00AB', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A3E)
        self.assertEqual(SccExtendedCharacter.LEFT_POINTING_GUILLEMET,
                         extended_char)
        self.assertEqual('\u00AB', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x123F)
        self.assertEqual(SccExtendedCharacter.RIGHT_POINTING_GUILLEMET,
                         extended_char)
        self.assertEqual('\u00BB', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A3F)
        self.assertEqual(SccExtendedCharacter.RIGHT_POINTING_GUILLEMET,
                         extended_char)
        self.assertEqual('\u00BB', extended_char.get_unicode_value())
    def test_scc_miscellaneous_extended_characters_unicode_values(self):
        extended_char = SccExtendedCharacter.find(0x1228)
        self.assertEqual(SccExtendedCharacter.ASTERISK, extended_char)
        self.assertEqual('\u002A', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A28)
        self.assertEqual(SccExtendedCharacter.ASTERISK, extended_char)
        self.assertEqual('\u002A', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1229)
        self.assertEqual(SccExtendedCharacter.NEUTRAL_SINGLE_QUOTATION_MARK,
                         extended_char)
        self.assertEqual('\u0027', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A29)
        self.assertEqual(SccExtendedCharacter.NEUTRAL_SINGLE_QUOTATION_MARK,
                         extended_char)
        self.assertEqual('\u0027', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x122A)
        self.assertEqual(SccExtendedCharacter.BOX_DRAWINGS_HEAVY_HORIZONTAL,
                         extended_char)
        self.assertEqual('\u2501', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A2A)
        self.assertEqual(SccExtendedCharacter.BOX_DRAWINGS_HEAVY_HORIZONTAL,
                         extended_char)
        self.assertEqual('\u2501', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x122B)
        self.assertEqual(SccExtendedCharacter.COPYRIGHT_SIGN, extended_char)
        self.assertEqual('\u00A9', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A2B)
        self.assertEqual(SccExtendedCharacter.COPYRIGHT_SIGN, extended_char)
        self.assertEqual('\u00A9', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x122C)
        self.assertEqual(SccExtendedCharacter.SERVICE_MARK, extended_char)
        self.assertEqual('\u2120', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A2C)
        self.assertEqual(SccExtendedCharacter.SERVICE_MARK, extended_char)
        self.assertEqual('\u2120', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x122D)
        self.assertEqual(SccExtendedCharacter.BULLET, extended_char)
        self.assertEqual('\u2022', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A2D)
        self.assertEqual(SccExtendedCharacter.BULLET, extended_char)
        self.assertEqual('\u2022', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x122E)
        self.assertEqual(SccExtendedCharacter.LEFT_DOUBLE_QUOTATION_MARK,
                         extended_char)
        self.assertEqual('\u201C', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A2E)
        self.assertEqual(SccExtendedCharacter.LEFT_DOUBLE_QUOTATION_MARK,
                         extended_char)
        self.assertEqual('\u201C', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x122F)
        self.assertEqual(SccExtendedCharacter.RIGHT_DOUBLE_QUOTATION_MARK,
                         extended_char)
        self.assertEqual('\u201D', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A2F)
        self.assertEqual(SccExtendedCharacter.RIGHT_DOUBLE_QUOTATION_MARK,
                         extended_char)
        self.assertEqual('\u201D', extended_char.get_unicode_value())
    def test_scc_spanish_extended_characters_unicode_values(self):
        extended_char = SccExtendedCharacter.find(0x1220)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_A_WITH_ACUTE,
            extended_char)
        self.assertEqual('\u00C1', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A20)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_A_WITH_ACUTE,
            extended_char)
        self.assertEqual('\u00C1', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1221)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_E_WITH_ACUTE,
            extended_char)
        self.assertEqual('\u00C9', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A21)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_E_WITH_ACUTE,
            extended_char)
        self.assertEqual('\u00C9', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1222)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_O_WITH_ACUTE,
            extended_char)
        self.assertEqual('\u00D3', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A22)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_O_WITH_ACUTE,
            extended_char)
        self.assertEqual('\u00D3', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1223)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_U_WITH_ACUTE,
            extended_char)
        self.assertEqual('\u00DA', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A23)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_U_WITH_ACUTE,
            extended_char)
        self.assertEqual('\u00DA', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1224)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_U_WITH_DIAERESIS,
            extended_char)
        self.assertEqual('\u00DC', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A24)
        self.assertEqual(
            SccExtendedCharacter.LATIN_CAPITAL_LETTER_U_WITH_DIAERESIS,
            extended_char)
        self.assertEqual('\u00DC', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1225)
        self.assertEqual(
            SccExtendedCharacter.LATIN_SMALL_LETTER_U_WITH_DIAERESIS,
            extended_char)
        self.assertEqual('\u00FC', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A25)
        self.assertEqual(
            SccExtendedCharacter.LATIN_SMALL_LETTER_U_WITH_DIAERESIS,
            extended_char)
        self.assertEqual('\u00FC', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1226)
        self.assertEqual(SccExtendedCharacter.LEFT_SINGLE_QUOTATION_MARK,
                         extended_char)
        self.assertEqual('\u2018', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A26)
        self.assertEqual(SccExtendedCharacter.LEFT_SINGLE_QUOTATION_MARK,
                         extended_char)
        self.assertEqual('\u2018', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1227)
        self.assertEqual(SccExtendedCharacter.INVERTED_EXCLAMATION_MARK,
                         extended_char)
        self.assertEqual('\u00A1', extended_char.get_unicode_value())

        extended_char = SccExtendedCharacter.find(0x1A27)
        self.assertEqual(SccExtendedCharacter.INVERTED_EXCLAMATION_MARK,
                         extended_char)
        self.assertEqual('\u00A1', extended_char.get_unicode_value())