summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2016-09-12 21:43:39 (GMT)
committer Vincent Sanders <vince@kyllikki.org>2016-09-12 21:43:39 (GMT)
commitca12878c2f0c1617a1b86a0c54b3a94b88c1caa6 (patch)
tree0b831d47f10a628d0a6713e349d43c1204aeecd1
parent9d858085c31a668aae89c696fef1a684c50cb8c6 (diff)
downloadnetsurf-ca12878c2f0c1617a1b86a0c54b3a94b88c1caa6.tar.gz
netsurf-ca12878c2f0c1617a1b86a0c54b3a94b88c1caa6.tar.bz2
use ascii processing when determining form charset
-rw-r--r--render/form.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/render/form.c b/render/form.c
index 8ae59b5..52e54e4 100644
--- a/render/form.c
+++ b/render/form.c
@@ -26,7 +26,6 @@
*/
#include <assert.h>
-#include <ctype.h>
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
@@ -40,6 +39,7 @@
#include "utils/url.h"
#include "utils/utf8.h"
#include "utils/utils.h"
+#include "utils/ascii.h"
#include "content/fetch.h"
#include "content/hlcache.h"
#include "css/utils.h"
@@ -980,8 +980,9 @@ char *form_acceptable_charset(struct form *form)
return NULL;
/* make it upper case */
- for (c = temp; *c; c++)
- *c = toupper(*c);
+ for (c = temp; *c; c++) {
+ *c = ascii_to_upper(*c);
+ }
/* is UTF-8 specified? */
c = strstr(temp, "UTF-8");
@@ -997,14 +998,14 @@ char *form_acceptable_charset(struct form *form)
* form element contains a space and/or comma separated list */
c = form->accept_charsets;
- /* What would be an improvement would be to choose an encoding
+ /** \todo an improvement would be to choose an encoding
* acceptable to the server which covers as much of the input
- * values as possible. Additionally, we need to handle the case
- * where none of the acceptable encodings cover all the textual
- * input values.
- * For now, we just extract the first element of the charset list
+ * values as possible. Additionally, we need to handle the
+ * case where none of the acceptable encodings cover all the
+ * textual input values. For now, we just extract the first
+ * element of the charset list
*/
- while (*c && !isspace(*c)) {
+ while (*c && !ascii_is_space(*c)) {
if (*c == ',')
break;
c++;