Kouhei Sutou
null+****@clear*****
Mon Jun 18 17:54:10 JST 2018
Kouhei Sutou 2018-06-18 17:54:10 +0900 (Mon, 18 Jun 2018) New Revision: 57cf8ad1900c45a528bda9db47b598593764de98 https://github.com/groonga/groonga/commit/57cf8ad1900c45a528bda9db47b598593764de98 Message: mrb: revert locale to UTF-8 conversion It didn't solve anything... Modified files: lib/mrb.c Modified: lib/mrb.c (+1 -40) =================================================================== --- lib/mrb.c 2018-06-18 17:20:11 +0900 (df04bf5d8) +++ lib/mrb.c 2018-06-18 17:54:10 +0900 (6c332163d) @@ -68,43 +68,6 @@ grn_mrb_is_order_by_estimated_size_enabled(void) #ifdef GRN_WITH_MRUBY # ifdef WIN32 -static char * -grn_mrb_string_locale_to_utf8(grn_ctx *ctx, const char *locale_string) -{ - size_t locale_string_bytes; - wchar_t *wide_string; - int n_wide_chars; - char *utf8_string; - int utf8_string_bytes; - - locale_string_bytes = strlen(locale_string); - n_wide_chars = MultiByteToWideChar(CP_ACP, 0, - locale_string, locale_string_bytes, - NULL, 0); - wide_string = GRN_MALLOCN(wchar_t, n_wide_chars); - if (!wide_string) { - return NULL; - } - n_wide_chars = MultiByteToWideChar(CP_ACP, 0, - locale_string, locale_string_bytes, - wide_string, n_wide_chars); - utf8_string_bytes = WideCharToMultiByte(CP_UTF8, 0, - wide_string, n_wide_chars, - NULL, 0, - NULL,NULL); - utf8_string = GRN_MALLOCN(char, utf8_string_bytes + 1); - if (!utf8_string) { - GRN_FREE(wide_string); - return NULL; - } - utf8_string_bytes = WideCharToMultiByte(CP_UTF8, 0, - wide_string, n_wide_chars, - utf8_string, utf8_string_bytes, - NULL, NULL); - utf8_string[utf8_string_bytes] = '\0'; - return utf8_string; -} - static char *windows_ruby_scripts_dir = NULL; static char windows_ruby_scripts_dir_buffer[PATH_MAX]; static const char * @@ -113,11 +76,9 @@ grn_mrb_get_default_system_ruby_scripts_dir(grn_ctx *ctx) if (!windows_ruby_scripts_dir) { const char *base_dir; const char *relative_path = GRN_RELATIVE_RUBY_SCRIPTS_DIR; - const char *utf8_base_dir; base_dir = grn_windows_base_dir(); - utf8_base_dir = grn_mrb_string_locale_to_utf8(ctx, base_dir); - grn_strcpy(windows_ruby_scripts_dir_buffer, PATH_MAX, utf8_base_dir); + grn_strcpy(windows_ruby_scripts_dir_buffer, PATH_MAX, base_dir); grn_strcat(windows_ruby_scripts_dir_buffer, PATH_MAX, "/"); grn_strcat(windows_ruby_scripts_dir_buffer, PATH_MAX, relative_path); windows_ruby_scripts_dir = windows_ruby_scripts_dir_buffer; -------------- next part -------------- HTML����������������������������... URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20180618/f0761a90/attachment-0001.htm