rune.c - sam - An updated version of the sam text editor. | |
git clone git://vernunftzentrum.de/sam.git | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
rune.c (289B) | |
--- | |
1 /* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
2 #include <u.h> | |
3 #include <string.h> | |
4 | |
5 int | |
6 chartorune(wchar_t *rune, char *str) | |
7 { | |
8 int r = mbtowc(rune, str, strlen(str)); | |
9 if (r < 0){ | |
10 *rune = UNICODE_REPLACEMENT_CHAR; | |
11 return 1; | |
12 } | |
13 return r; | |
14 } |