utf8_exceptions.cpp 972 B

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // $Id$
  3. //
  4. #include<__vic/utf8/exceptions.h>
  5. namespace __vic { namespace utf8 {
  6. //------------------------------------------------------------------------------
  7. const char *no_leading_byte::what() const noexcept
  8. {
  9. return "No UTF-8 leading byte found"; // unexpected continuation byte
  10. }
  11. //------------------------------------------------------------------------------
  12. const char *truncated_code_point::what() const noexcept
  13. {
  14. return "Truncated UTF-8 code point"; // incomplete multibyte sequence
  15. }
  16. //------------------------------------------------------------------------------
  17. const char *overlong_encoding::what() const noexcept
  18. {
  19. return "Overlong UTF-8 encoding";
  20. }
  21. //------------------------------------------------------------------------------
  22. const char *code_point_too_big::what() const noexcept
  23. {
  24. return "UTF-8 code point value is too big";
  25. }
  26. //------------------------------------------------------------------------------
  27. }} // namespace