[Groonga-commit] droonga/grn2drn at ed36a83 [master] Covnert encoding by the input layer instead of converter

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Jul 10 12:26:04 JST 2014


YUKI Hiroshi	2014-07-10 12:26:04 +0900 (Thu, 10 Jul 2014)

  New Revision: ed36a83d8fe8d3d238bdcdb42098ed67c5f54fc1
  https://github.com/droonga/grn2drn/commit/ed36a83d8fe8d3d238bdcdb42098ed67c5f54fc1

  Message:
    Covnert encoding by the input layer instead of converter

  Modified files:
    bin/grn2drn
    lib/grn2drn/command-converter.rb

  Modified: bin/grn2drn (+2 -1)
===================================================================
--- bin/grn2drn    2014-07-10 12:15:46 +0900 (abc6fb6)
+++ bin/grn2drn    2014-07-10 12:26:04 +0900 (31cd0cb)
@@ -82,7 +82,6 @@ convert_options = {
   :date => options.date,
   :reply_to => options.reply_to,
   :dataset => options.dataset,
-  :encoding => options.encoding,
 }
 converter = Grn2Drn::CommandConverter.new(convert_options)
 
@@ -96,6 +95,8 @@ def open_output(path)
   end
 end
 
+ARGF.set_encoding(options.encoding)
+
 open_output(options.output_path) do |output|
   converter.convert(ARGF) do |command|
     output.puts(JSON.generate(command))

  Modified: lib/grn2drn/command-converter.rb (+1 -2)
===================================================================
--- lib/grn2drn/command-converter.rb    2014-07-10 12:15:46 +0900 (7aae535)
+++ lib/grn2drn/command-converter.rb    2014-07-10 12:26:04 +0900 (1f612e9)
@@ -53,9 +53,8 @@ module Grn2Drn
         command.original_source.clear
       end
 
-      encoding = @options[:encoding] || "UTF-8"
       input.each_line do |line|
-        @command_parser << line.force_encoding(encoding)
+        @command_parser << line
       end
       @command_parser.finish
     end
-------------- next part --------------
HTML����������������������������...
Download 



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