utf8_validator_tables.h 908 B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright 2014 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef BASE_I18N_UTF8_VALIDATOR_TABLES_H_
  5. #define BASE_I18N_UTF8_VALIDATOR_TABLES_H_
  6. #include <stddef.h>
  7. #include <stdint.h>
  8. #include "base/macros.h"
  9. namespace base {
  10. namespace internal {
  11. // The tables for all states; a list of entries of the form (right_shift,
  12. // next_state, next_state, ....). The right_shifts are used to reduce the
  13. // overall size of the table. The table only covers bytes in the range
  14. // [0x80, 0xFF] to save space.
  15. extern const uint8_t kUtf8ValidatorTables[];
  16. extern const size_t kUtf8ValidatorTablesSize;
  17. // The offset of the INVALID state in kUtf8ValidatorTables.
  18. enum {
  19. I18N_UTF8_VALIDATOR_INVALID_INDEX = 129
  20. };
  21. } // namespace internal
  22. } // namespace base
  23. #endif // BASE_I18N_UTF8_VALIDATOR_TABLES_H_