diff options
Diffstat (limited to 'bdep/utility.cxx')
-rw-r--r-- | bdep/utility.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/bdep/utility.cxx b/bdep/utility.cxx index 5a547eb..0ec3233 100644 --- a/bdep/utility.cxx +++ b/bdep/utility.cxx @@ -297,4 +297,18 @@ namespace bdep r.push_back ("}"); } } + + void + validate_utf8_graphic (const string& s, const char* what, const char* opt) + { + if (!utf8 (s, codepoint_types::graphic)) + { + diag_record dr (fail); + dr << what << " '" << s << "' is not UTF-8 encoded or contains " + << "non-graphic Unicode codepoints"; + + if (opt != nullptr) + dr << info << "consider using " << opt << " to override"; + } + } } |