extern "C" {
#endif
+#ifndef _di_f_utf_is_
+ f_return_status f_utf_is(const f_string character, const f_u_short max_width) {
+ #ifndef _di_level_0_parameter_checking_
+ if (max_width < 1) return f_status_set_error(f_invalid_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ f_u_short width = f_macro_utf_byte_width_is(*character);
+
+ if (width == 0) {
+ return f_false;
+ }
+ else if (width == 1) {
+ return f_status_is_error(f_incomplete_utf);
+ }
+
+ return f_true;
+ }
+#endif // _di_f_utf_is_
+
#ifndef _di_f_utf_is_bom_
f_return_status f_utf_is_bom(const f_string character, const f_u_short max_width) {
#ifndef _di_level_0_parameter_checking_
}
#endif // _di_f_utf_is_bom_
+#ifndef _di_f_utf_is_character_
+ f_return_status f_utf_is_character(const f_utf_character character) {
+ f_u_short width = f_macro_utf_character_width_is(character);
+
+ if (width == 0) {
+ return f_false;
+ }
+ else if (width == 1) {
+ return f_status_is_error(f_incomplete_utf);
+ }
+
+ return f_true;
+ }
+#endif // _di_f_utf_is_
+
#ifndef _di_f_utf_is_graph_
f_return_status f_utf_is_graph(const f_string character, const f_u_short max_width) {
#ifndef _di_level_0_parameter_checking_
#endif // _di_f_utf_substitute_
/**
+ * Check to see if the entire byte block of the character is a UTF-8 character.
+ *
+ * @param character
+ * The character to validate.
+ * There must be enough space allocated to compare against, as limited by max_width.
+ * @param max_width
+ * The maximum width available for checking.
+ * Can be anything greater than 0.
+ *
+ * @return
+ * f_true if a UTF-8 character.
+ * f_false if not a UTF-8 character.
+ * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment.
+ * f_invalid_parameter (with error bit) if a parameter is invalid.
+ */
+#ifndef _di_f_utf_is_
+ extern f_return_status f_utf_is(const f_string character, const f_u_short max_width);
+#endif // _di_f_utf_is_
+
+/**
* Check to see if the entire byte block of the character is a UTF-8 BOM.
*
* @param character
#endif // _di_f_utf_is_bom_
/**
+ * Check to see if the entire byte block of the character is a UTF-8 character.
+ *
+ * @param character
+ * The character to validate.
+ *
+ * @return
+ * f_true if a UTF-8 character.
+ * f_false if not a UTF-8 character.
+ * f_incomplete_utf (with error bit) if character is an incomplete UTF-8 fragment.
+ * f_invalid_parameter (with error bit) if a parameter is invalid.
+ */
+#ifndef _di_f_utf_is_
+ extern f_return_status f_utf_is_character(const f_utf_character character);
+#endif // _di_f_utf_is_
+
+/**
* Check to see if the entire byte block of the character is a UTF-8 printable character.
*
* This does not check non-UTF-8 graph.