aboutsummaryrefslogtreecommitdiff
path: root/bdep/utility.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-01-28 20:44:28 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-01-29 16:27:48 +0300
commita431fe8a8dfbbe121a30c66df0424be6351ae9ff (patch)
treea608ce67f1677ea318481f0e31f0a1031b4fc223 /bdep/utility.cxx
parentf93e1e81eac9bcce3d11379e4cdefed5cf6093fd (diff)
Validate that values submitted to CI and submission services contain UTF-8 encoded graphic characters only
Diffstat (limited to 'bdep/utility.cxx')
-rw-r--r--bdep/utility.cxx14
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";
+ }
+ }
}