summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
38558cf)
specify characters to 'confuse' is to just put them on the command
line in the system multibyte encoding! In a UTF-8 terminal environment
this may very well be the easiest thing.
git-svn-id: svn://svn.tartarus.org/sgt/charset@9584
cda61777-01e9-0310-a592-
d414129be87e
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int i, j, k, cs;
const char *sep;
int i, j, k, cs;
const char *sep;
+ setlocale(LC_ALL, "");
+
chars = malloc(argc * sizeof(wchar_t));
if (!chars) {
fprintf(stderr, "out of memory\n");
chars = malloc(argc * sizeof(wchar_t));
if (!chars) {
fprintf(stderr, "out of memory\n");
char *orig = p;
char *end;
int base = 16, semi_ok = 0;
char *orig = p;
char *end;
int base = 16, semi_ok = 0;
if ((p[0] == 'U' || p[0] == 'u') &&
(p[1] == '-' || p[1] == '+')) {
if ((p[0] == 'U' || p[0] == 'u') &&
(p[1] == '-' || p[1] == '+')) {
else
base = 10;
semi_ok = 1;
else
base = 10;
semi_ok = 1;
+ } else if (mbtowc(&ch, p, strlen(p)) == strlen(p)) {
+ chars[nchars++] = ch;
+ continue;
}
chars[nchars++] = strtoul(p, &end, base);
}
chars[nchars++] = strtoul(p, &end, base);