From 999cdf0007c004450c6ef17516ff9de4f765e30b Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Thu, 14 Jan 2016 22:02:46 -0500 Subject: [PATCH] common: Added unicodeLatinDigit --- src/common/unicode.cpp | 9 +++++++++ src/common/unicode.h | 1 + 2 files changed, 10 insertions(+) diff --git a/src/common/unicode.cpp b/src/common/unicode.cpp index 8d2a36a9..889cde0e 100644 --- a/src/common/unicode.cpp +++ b/src/common/unicode.cpp @@ -78,3 +78,12 @@ bool unicodeLatinAlpha (unsigned int c) } //////////////////////////////////////////////////////////////////////////////// +// Digits 0-9. +// +// TODO This list should be derived from the Unicode database. +bool unicodeLatinDigit (unsigned int c) +{ + return c >= 0x30 && c <= 0x39; +} + +//////////////////////////////////////////////////////////////////////////////// diff --git a/src/common/unicode.h b/src/common/unicode.h index 51c3b21c..bf4b3ff8 100644 --- a/src/common/unicode.h +++ b/src/common/unicode.h @@ -29,6 +29,7 @@ bool unicodeWhitespace (unsigned int); bool unicodeLatinAlpha (unsigned int); +bool unicodeLatinDigit (unsigned int); #endif ////////////////////////////////////////////////////////////////////////////////