[Groonga-commit] groonga/groonga at 53e29be [master] mecab: convert error message encoding

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Jun 22 11:55:20 JST 2018


Kouhei Sutou	2018-06-22 11:55:20 +0900 (Fri, 22 Jun 2018)

  New Revision: 53e29be3cc1ddd1e8d5702fd85951195d0b049be
  https://github.com/groonga/groonga/commit/53e29be3cc1ddd1e8d5702fd85951195d0b049be

  Message:
    mecab: convert error message encoding

  Modified files:
    plugins/tokenizers/mecab.c

  Modified: plugins/tokenizers/mecab.c (+13 -5)
===================================================================
--- plugins/tokenizers/mecab.c    2018-06-22 11:43:42 +0900 (7a1e80eaa)
+++ plugins/tokenizers/mecab.c    2018-06-22 11:55:20 +0900 (a4df6326a)
@@ -25,6 +25,8 @@
 #include <groonga.h>
 #include <groonga/tokenizer.h>
 
+#include <grn_encoding.h>
+
 #include <mecab.h>
 
 #include <stdlib.h>
@@ -315,11 +317,17 @@ mecab_create(grn_ctx *ctx)
 
   if (!mecab) {
 #ifdef GRN_WITH_BUNDLED_MECAB
-    GRN_PLUGIN_ERROR(ctx, GRN_TOKENIZER_ERROR,
-                     "[tokenizer][mecab] failed to create mecab_t: %s: "
-                     "mecab_new(\"%s\", \"%s\", \"%s\", \"%s\")",
-                     mecab_global_error_message(),
-                     argv[0], argv[1], argv[2], argv[3]);
+    {
+      const char *grn_encoding_rc_file;
+      grn_encoding_rc_file =
+        grn_encoding_convert_from_locale(ctx, argv[3], -1, NULL);
+      GRN_PLUGIN_ERROR(ctx, GRN_TOKENIZER_ERROR,
+                       "[tokenizer][mecab] failed to create mecab_t: %s: "
+                       "mecab_new(\"%s\", \"%s\", \"%s\", \"%s\")",
+                       mecab_global_error_message(),
+                       argv[0], argv[1], argv[2], grn_encoding_rc_file);
+      grn_encoding_converted_free(ctx, grn_encoding_rc_file);
+    }
 #else /* GRN_WITH_BUNDLED_MECAB */
     GRN_PLUGIN_ERROR(ctx, GRN_TOKENIZER_ERROR,
                      "[tokenizer][mecab] failed to create mecab_t: %s: "
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20180622/4fcd6318/attachment-0001.htm 



More information about the Groonga-commit mailing list
Back to archive index