diff options
author | Chris West <therealchriswest@hotmail.com> | 2013-01-13 22:03:37 +0000 |
---|---|---|
committer | Chris West <therealchriswest@hotmail.com> | 2013-01-19 16:46:46 +0000 |
commit | b72183a640caeb04b1d800ab1eb2233d8ce9dc47 (patch) | |
tree | fa3507382a7e8420495b844f093235f6c732dea4 /crawl-ref/source/unicode.cc | |
parent | fd1dd18e5c8a188aa3b1ca7333ef42ed328c614f (diff) | |
download | crawl-ref-b72183a640caeb04b1d800ab1eb2233d8ce9dc47.tar.gz crawl-ref-b72183a640caeb04b1d800ab1eb2233d8ce9dc47.zip |
fixed compilation bug under Android
Diffstat (limited to 'crawl-ref/source/unicode.cc')
-rw-r--r-- | crawl-ref/source/unicode.cc | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/crawl-ref/source/unicode.cc b/crawl-ref/source/unicode.cc index 7529b5ea01..3768c12e5e 100644 --- a/crawl-ref/source/unicode.cc +++ b/crawl-ref/source/unicode.cc @@ -195,6 +195,24 @@ string utf8_to_mb(const char *s) #endif } +static string utf8_validate(const char *s) +{ + string d; + ucs_t c; + int l; + + while ((l = utf8towc(&c, s))) + { + s += l; + + char buf[4]; + int r = wctoutf8(buf, c); + for (int i = 0; i < r; i++) + d.push_back(buf[i]); + } + return d; +} + string mb_to_utf8(const char *s) { #ifdef __ANDROID__ @@ -228,24 +246,6 @@ string mb_to_utf8(const char *s) #endif } -static string utf8_validate(const char *s) -{ - string d; - ucs_t c; - int l; - - while ((l = utf8towc(&c, s))) - { - s += l; - - char buf[4]; - int r = wctoutf8(buf, c); - for (int i = 0; i < r; i++) - d.push_back(buf[i]); - } - return d; -} - static bool _check_trail(FILE *f, const char* bytes, int len) { while (len--) |