chiark / gitweb /
utf8: ascii_filter() is unused, let's remove it
[elogind.git] / src / shared / utf8.c
index 31120af046f1b091caf9253fa6dcae281ff3b369..aedf6e29ea3e8fd9e4267ab39cb37575ceb3c13c 100644 (file)
@@ -98,7 +98,7 @@ static int utf8_encoded_expected_len(const char *str) {
 }
 
 /* decode one unicode char */
-static int utf8_encoded_to_unichar(const char *str) {
+int utf8_encoded_to_unichar(const char *str) {
         int unichar;
         int len;
         int i;
@@ -184,27 +184,6 @@ char *ascii_is_valid(const char *str) {
         return (char*) str;
 }
 
-char *ascii_filter(const char *str) {
-        const char *s;
-        char *r, *d;
-        size_t l;
-
-        assert(str);
-
-        l = strlen(str);
-        r = malloc(l + 1);
-        if (!r)
-                return NULL;
-
-        for (s = str, d = r; *s; s++)
-                if ((unsigned char) *s < 128)
-                        *(d++) = *s;
-
-        *d = 0;
-
-        return r;
-}
-
 char *utf16_to_utf8(const void *s, size_t length) {
         char *r;
         const uint8_t *f;