diff options
author | robi <robi> | 2011-11-06 18:26:13 +0000 |
---|---|---|
committer | robi <robi> | 2011-11-06 18:26:13 +0000 |
commit | 4df80ec1b6fe317e211b5e2b310c3b3af4b219e5 (patch) | |
tree | c1ff5e22653450f7af1e01feed1f85447d618ee2 /src/util.c | |
parent | 5dbcad7cad4ea8edcc02415ac11a9a97bc5b333f (diff) |
new:function for RPM + XCF ;change:TTF ZIP DEB Perl+Python and some other TXT
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -660,3 +660,25 @@ int zero_space(unsigned char *buf, __u32 offset){ i++; return (i == end ) ? 1 : 0 ; } + +int is_unicode( unsigned char* buf){ + int ret = 0; + unsigned char *p = buf; + unsigned char *p1 = buf +1; + if ((*p > 0xc1) && (*p < 0xf5) && (*p1 > 0x7f) && (*p1 < 0xc0)){ + if (!(*p & 0x20)) + ret = 2; + else{ + p1++; + if ((!(*p & 0x10)) && (*p1 > 0x7f) && (*p1 < 0xc0)) + ret = 3 ; + else{ + p1++; + if ((!(*p & 0x08)) && (*p1 > 0x7f) && (*p1 < 0xc0)) + ret = 4 ; + } + } + } + return ret; +} + |