Index: boot/generic/src/str.c
===================================================================
--- boot/generic/src/str.c	(revision d9faae914207b40d4451fcb520ca187b3b8558bf)
+++ boot/generic/src/str.c	(revision 795448f8063376ee6a3c51df46d8ed2f4efaf83e)
@@ -100,4 +100,11 @@
 #include <str.h>
 #include <errno.h>
+
+/** Check the condition if wchar_t is signed */
+#ifdef WCHAR_IS_UNSIGNED
+	#define WCHAR_SIGNED_CHECK(cond)  (true)
+#else
+	#define WCHAR_SIGNED_CHECK(cond)  (cond)
+#endif
 
 /** Byte mask consisting of lowest @n bits (out of 8) */
@@ -198,5 +205,5 @@
  *         code was invalid.
  */
-int chr_encode(wchar_t ch, char *str, size_t *offset, size_t size)
+int chr_encode(const wchar_t ch, char *str, size_t *offset, size_t size)
 {
 	if (*offset >= size)
@@ -325,5 +332,5 @@
 bool ascii_check(wchar_t ch)
 {
-	if ((ch >= 0) && (ch <= 127))
+	if (WCHAR_SIGNED_CHECK(ch >= 0) && (ch <= 127))
 		return true;
 	
@@ -338,5 +345,5 @@
 bool chr_check(wchar_t ch)
 {
-	if ((ch >= 0) && (ch <= 1114111))
+	if (WCHAR_SIGNED_CHECK(ch >= 0) && (ch <= 1114111))
 		return true;
 	
