Browse Source

[Minor] Add workaround for Thai characters on CentOS 6

tags/1.8.2
Vsevolod Stakhov 5 years ago
parent
commit
6d7d30ec87
1 changed files with 13 additions and 0 deletions
  1. 13
    0
      src/libmime/message.c

+ 13
- 0
src/libmime/message.c View File

@@ -33,6 +33,7 @@
#endif

#include <math.h>
#include <unicode/uchar.h>

#define GTUBE_SYMBOL "GTUBE"

@@ -202,7 +203,19 @@ rspamd_mime_part_create_words (struct rspamd_task *task,
enum rspamd_tokenize_type tok_type;

if (IS_PART_UTF (part)) {

#if U_ICU_VERSION_MAJOR_NUM < 50
/* Hack to prevent hang with Thai in old libicu */
if (part->unicode_scripts & RSPAMD_UNICODE_THAI) {
msg_info_task ("enable workaround for Thai characters for old libicu")
tok_type = RSPAMD_TOKENIZE_RAW;
}
else {
tok_type = RSPAMD_TOKENIZE_UTF;
}
#else
tok_type = RSPAMD_TOKENIZE_UTF;
#endif
}
else {
tok_type = RSPAMD_TOKENIZE_RAW;

Loading…
Cancel
Save