defs.h 613 B

12345678910111213141516171819202122232425262728
  1. // UTF-8 core definitions
  2. //
  3. // Platform: ISO C++ 98/11
  4. // $Id$
  5. //
  6. // (c) __vic 2013
  7. #ifndef __VIC_UTF8_DEFS_H
  8. #define __VIC_UTF8_DEFS_H
  9. #include<__vic/defs.h>
  10. #include<__vic/unicode.h>
  11. namespace __vic { namespace utf8 {
  12. //----------------------------------------------------------------------------
  13. // byte has form 10xxxxxx
  14. inline bool is_continuation_byte(unsigned char b)
  15. {
  16. return (b & 0xC0) == 0x80; // 10xxxxxx
  17. }
  18. //----------------------------------------------------------------------------
  19. extern const unicode_t length_thresholds[5]; // internal variable
  20. }} // namespace
  21. #endif // header guard