diff options
author | uema2 <uema2@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-06-05 12:33:19 +0000 |
---|---|---|
committer | uema2 <uema2@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-06-05 12:33:19 +0000 |
commit | b5d717afda44c19b652dfd1a6a2b721fa93a2762 (patch) | |
tree | 661d11a03372b854e02919879ff88be2db155d1b /wince/stdlib.c | |
parent | b1937a53e664fec371cbb0f7985cbd845cf33b81 (diff) | |
download | ruby-b5d717afda44c19b652dfd1a6a2b721fa93a2762.tar.gz |
* wince/stdlib.c: add mblen().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'wince/stdlib.c')
-rw-r--r-- | wince/stdlib.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/wince/stdlib.c b/wince/stdlib.c index b3d5f3bb6e..c7f0c8428a 100644 --- a/wince/stdlib.c +++ b/wince/stdlib.c @@ -20,3 +20,20 @@ char *_fullpath(char *absPath, const char *relPath, return absPath; } +int mblen(const char *mbstr, size_t count) +{ + const char *p = mbstr; + size_t i; + int n=0; + + for( i=0; i<count; i++ ) + { + if( *p=='\0' ) break; + if( IsDBCSLeadByteEx( CP_ACP, *p ) ) + n+=2; + else + n+=1; + } + + return n; +} |