summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/messages.c19
-rw-r--r--utils/messages.h1
-rw-r--r--utils/url.c3
-rw-r--r--utils/utf8.h6
-rw-r--r--utils/utils.h1
5 files changed, 9 insertions, 21 deletions
diff --git a/utils/messages.c b/utils/messages.c
index f2ed3e037..3b5b6d662 100644
--- a/utils/messages.c
+++ b/utils/messages.c
@@ -53,7 +53,7 @@ static unsigned int messages_hash(const char *s);
void messages_load(const char *path)
{
- char s[300];
+ char s[400];
FILE *fp;
fp = fopen(path, "r");
@@ -121,23 +121,6 @@ const char *messages_get(const char *key)
return entry->value;
}
-/**
- * Retrieve the key associated with a value
- *
- * \param value The value as returned by messages_get
- * \return The key associated with the value or NULL if not found
- */
-const char *messages_get_key(const char *value)
-{
- const char *key = value - MAX_KEY_LENGTH;
- const char *temp_value = messages_get(key);
-
- if (strcmp(value, temp_value) == 0)
- return key;
-
- return NULL;
-}
-
/**
* Hash function for keys.
diff --git a/utils/messages.h b/utils/messages.h
index 33b2fc3f4..4ca079293 100644
--- a/utils/messages.h
+++ b/utils/messages.h
@@ -23,7 +23,6 @@
void messages_load(const char *path);
const char *messages_get(const char *key);
-const char *messages_get_key(const char *value);
void messages_dump(void);
#endif
diff --git a/utils/url.c b/utils/url.c
index 69e3a9293..c602af912 100644
--- a/utils/url.c
+++ b/utils/url.c
@@ -567,10 +567,11 @@ url_func_result url_nice(const char *url, char **result)
if (15 < k + i)
break;
if (k)
- k++;
+ k+=2;
strncpy(buf + k, rurl + j + so, i);
k += i;
buf[k] = 160; /* nbsp */
+ buf[k+1] = 0xc2; /* as UTF-8 */
}
j += match[0].rm_eo;
diff --git a/utils/utf8.h b/utils/utf8.h
index a77af29d0..a1a1c4e9a 100644
--- a/utils/utf8.h
+++ b/utils/utf8.h
@@ -31,6 +31,12 @@ utf8_convert_ret utf8_to_enc(const char *string, const char *encname,
utf8_convert_ret utf8_from_enc(const char *string, const char *encname,
size_t len, char **result);
+/* These two are platform specific */
+utf8_convert_ret utf8_to_local_encoding(const char *string, size_t len,
+ char **result);
+utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len,
+ char **result);
+
void utf8_finalise(void);
#endif
diff --git a/utils/utils.h b/utils/utils.h
index 27c4be7d6..50623670e 100644
--- a/utils/utils.h
+++ b/utils/utils.h
@@ -62,6 +62,5 @@ void die(const char * const error);
void warn_user(const char *warning, const char *detail);
query_id query_user(const char *query, const char *detail, const query_callback *cb, void *pw);
void query_close(query_id);
-const char *local_encoding_name(void);
#endif