Displaying 1 result from an estimated 1 matches for "encoding_recommendation".
2011 Sep 17
3
[PATCH 1/1] hivexml: Base64-encode non-printable data
...e <errno.h>
#include <time.h>
#include <locale.h>
+#include <ctype.h>
#ifdef HAVE_LIBINTL_H
#include <libintl.h>
@@ -201,6 +202,52 @@ filetime_to_8601 (int64_t windows_ticks)
return ret;
}
+/* Caller need not free return value afterwards. */
+static char *
+encoding_recommendation (const char *data)
+{
+ /* Note that this function assumes data is null-terminated. */
+ //See if the data are printable
+ int is_printable = 0;
+ size_t i;
+ size_t data_len = strlen(data);
+
+ for (i=0; i < data_len; i++) {
+ is_printable = isprint (data[i]);
+ if (!is_printable) {...