summaryrefslogtreecommitdiff
path: root/src/string_func.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-10-22 12:15:58 +0000
committerrubidium <rubidium@openttd.org>2010-10-22 12:15:58 +0000
commitb933819b0b0f07d4f2aef590f76898b35fdea607 (patch)
tree5c1c71c2d7f98b065827e70a5f0e8dfd0efc51ce /src/string_func.h
parent2d64b482baabe88233564806fae77c875581c0f8 (diff)
downloadopenttd-b933819b0b0f07d4f2aef590f76898b35fdea607.tar.xz
(svn r21006) -Fix (r21004): don't print the text direction character when ICU isn't linked and thus doesn't remove them
Diffstat (limited to 'src/string_func.h')
-rw-r--r--src/string_func.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/string_func.h b/src/string_func.h
index 082543dae..b2e88f52b 100644
--- a/src/string_func.h
+++ b/src/string_func.h
@@ -224,6 +224,28 @@ static inline char *Utf8PrevChar(char *s)
return ret;
}
+/**
+ * Is the given character a text direction character.
+ * @param c The character to test.
+ * @return true iff the character is used to influence
+ * the text direction.
+ */
+static inline bool IsTextDirectionChar(WChar c)
+{
+ switch (c) {
+ case CHAR_TD_LRM:
+ case CHAR_TD_RLM:
+ case CHAR_TD_LRE:
+ case CHAR_TD_RLE:
+ case CHAR_TD_LRO:
+ case CHAR_TD_RLO:
+ case CHAR_TD_PDF:
+ return true;
+
+ default:
+ return false;
+ }
+}
static inline bool IsPrintable(WChar c)
{