From ea617f93805e0487b8a1e8831b4f36cf444ee845 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Thu, 1 Jan 2015 16:32:01 +0300 Subject: [PATCH] Clarify IsNameStartChar() - resolve issue 250 --- tinyxml2.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tinyxml2.h b/tinyxml2.h index 530160f..7f997aa 100755 --- a/tinyxml2.h +++ b/tinyxml2.h @@ -552,9 +552,14 @@ public: } inline static bool IsNameStartChar( unsigned char ch ) { - return ( ( ch < 128 ) ? isalpha( ch ) : 1 ) - || ch == ':' - || ch == '_'; + if ( ch >= 128 ) { + // This is a heuristic guess in attempt to not implement Unicode-aware isalpha() + return true; + } + if ( isalpha( ch ) ) { + return true; + } + return ch == ':' || ch == '_'; } inline static bool IsNameChar( unsigned char ch ) {