summaryrefslogtreecommitdiffstats
path: root/common/sys/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/sys/string.c')
-rw-r--r--common/sys/string.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/common/sys/string.c b/common/sys/string.c
index 881a0e04..908f1fb4 100644
--- a/common/sys/string.c
+++ b/common/sys/string.c
@@ -311,6 +311,26 @@ int DBCS_RemoveIntrEscape(unsigned char *buf, int *len)
return (oldl != l) ? 1 : 0;
}
+int DBCS_Status(const char *dbcstr, int pos)
+{
+ int sts = DBCS_ASCII;
+ const unsigned char *s = (const unsigned char*)dbcstr;
+
+ while(pos >= 0)
+ {
+ if(sts == DBCS_LEADING)
+ sts = DBCS_TRAILING;
+ else if (*s >= 0x80)
+ {
+ sts = DBCS_LEADING;
+ } else {
+ sts = DBCS_ASCII;
+ }
+ s++, pos--;
+ }
+ return sts;
+}
+
/* ----------------------------------------------------- */
/* 字串檢查函數:英文、數字、檔名、E-mail address */
/* ----------------------------------------------------- */