summaryrefslogtreecommitdiffstats
path: root/engines
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2013-11-11 17:41:31 +0100
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2013-11-11 17:41:31 +0100
commit62da7abf083ca1f9305f66c5f9f0683267a01e65 (patch)
tree5f37e274d76f236249e54591160c1b46ef0c8724 /engines
parent77707bc1f75c237d1e4ecdab3fbf567a8d0ac3e8 (diff)
downloadlibrcc-62da7abf083ca1f9305f66c5f9f0683267a01e65.tar.gz
librcc-62da7abf083ca1f9305f66c5f9f0683267a01e65.tar.bz2
librcc-62da7abf083ca1f9305f66c5f9f0683267a01e65.tar.xz
librcc-62da7abf083ca1f9305f66c5f9f0683267a01e65.zip
Support LibGuess 1.1
Diffstat (limited to 'engines')
-rw-r--r--engines/libguess.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/engines/libguess.c b/engines/libguess.c
index 18d2ca5..dd89ced 100644
--- a/engines/libguess.c
+++ b/engines/libguess.c
@@ -19,9 +19,31 @@
#include <stdio.h>
#include <string.h>
+#include "../config.h"
#include <librcc.h>
-#include <libguess.h>
+
+#ifdef HAVE_LIBGUESS_LIBGUESS_H
+# include <libguess/libguess.h>
+static const char *guess_jp(const char *buf, int buflen) {
+ return libguess_determine_encoding(buf, buflen, GUESS_REGION_JP);
+}
+
+static const char *guess_cn(const char *buf, int buflen) {
+ return libguess_determine_encoding(buf, buflen, GUESS_REGION_CN);
+}
+
+static const char *guess_tw(const char *buf, int buflen) {
+ return libguess_determine_encoding(buf, buflen, GUESS_REGION_TW);
+}
+
+static const char *guess_kr(const char *buf, int buflen) {
+ return libguess_determine_encoding(buf, buflen, GUESS_REGION_KR);
+}
+
+#else /* HAVE_LIBGUESS_H */
+# include <libguess.h>
+#endif /* HAVE_LIBGUESS_LIBGUESS_H */
#define UTF8_ID 0
#define UTF16_ID 1