diff options
author | rubidium <rubidium@openttd.org> | 2010-10-21 20:12:48 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-10-21 20:12:48 +0000 |
commit | 87edf2524d8904189391b427a9c823cb3d5fdf03 (patch) | |
tree | 5ec3718ba52a2dc2faff4c629269563996f348da /src/string_type.h | |
parent | a671f64896251875f8b881db69ce1cc9cb358f5c (diff) | |
download | openttd-87edf2524d8904189391b427a9c823cb3d5fdf03.tar.xz |
(svn r21004) -Fix [FS#3746]: chat/console messages got sometimes messed up due to LTR names in RTL translations and vice-versa
Diffstat (limited to 'src/string_type.h')
-rw-r--r-- | src/string_type.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/string_type.h b/src/string_type.h index 7fb8e0137..9532c86ad 100644 --- a/src/string_type.h +++ b/src/string_type.h @@ -15,6 +15,9 @@ /** A non-breaking space. */ #define NBSP "\xC2\xA0" +/** A left-to-right marker, marks the next character as left-to-right. */ +#define LRM "\xE2\x80\x8E" + /** * Valid filter types for IsValidChar. */ @@ -28,4 +31,14 @@ enum CharSetFilter { typedef uint32 WChar; +/* The following are directional formatting codes used to get the LTR and RTL strings right: + * http://www.unicode.org/unicode/reports/tr9/#Directional_Formatting_Codes */ +static const WChar CHAR_TD_LRM = 0x200E; ///< The next character acts like a left-to-right character. +static const WChar CHAR_TD_RLM = 0x200F; ///< The next character acts like a right-to-left character. +static const WChar CHAR_TD_LRE = 0x202A; ///< The following text is embedded left-to-right. +static const WChar CHAR_TD_RLE = 0x202B; ///< The following text is embedded right-to-left. +static const WChar CHAR_TD_LRO = 0x202D; ///< Force the following characters to be treated as left-to-right characters. +static const WChar CHAR_TD_RLO = 0x202E; ///< Force the following characters to be treated as right-to-left characters. +static const WChar CHAR_TD_PDF = 0x202C; ///< Restore the text-direction state to before the last LRE, RLE, LRO or RLO. + #endif /* STRING_TYPE_H */ |