diff options
author | Damien George <damien.p.george@gmail.com> | 2014-05-10 17:50:05 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-05-10 17:50:05 +0100 |
commit | 7db57bf6b227f33d66493ab3252621ed0895d995 (patch) | |
tree | 62ed362e97320fd14b1eaa7a4de9be9830b037c6 /py/unicode.c | |
parent | b0edec61ac2eeb3bb5c787639ea0cecaa71ea79d (diff) | |
parent | 69135219111be239d6088457604dcfc185e6ceee (diff) | |
download | micropython-7db57bf6b227f33d66493ab3252621ed0895d995.tar.gz micropython-7db57bf6b227f33d66493ab3252621ed0895d995.zip |
Merge branch 'master' of github.com:micropython/micropython
Diffstat (limited to 'py/unicode.c')
-rw-r--r-- | py/unicode.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/py/unicode.c b/py/unicode.c index fff6030fc0..1cd82f3be8 100644 --- a/py/unicode.c +++ b/py/unicode.c @@ -97,6 +97,7 @@ bool unichar_isxdigit(unichar c) { bool char_is_alpha_or_digit(unichar c) { return c < 128 && (attr[c] & (FL_ALPHA | FL_DIGIT)) != 0; } +*/ bool char_is_upper(unichar c) { return c < 128 && (attr[c] & FL_UPPER) != 0; @@ -105,4 +106,17 @@ bool char_is_upper(unichar c) { bool char_is_lower(unichar c) { return c < 128 && (attr[c] & FL_LOWER) != 0; } -*/ + +unichar unichar_tolower(unichar c) { + if (char_is_upper(c)) { + return c + 0x20; + } + return c; +} + +unichar unichar_toupper(unichar c) { + if (char_is_lower(c)) { + return c - 0x20; + } + return c; +} |