lib/gettext/mo.rb in gettext-1.10.0-mswin32 vs lib/gettext/mo.rb in gettext-1.90.0
- old
+ new
@@ -10,11 +10,11 @@
You can redistribute this file and/or modify it under the same term
of Ruby. License of Ruby is included with Ruby distribution in
the file "README".
- $Id: mo.rb,v 1.7 2006/06/11 15:36:20 mutoh Exp $
+ $Id: mo.rb,v 1.8 2007/11/10 02:51:21 mutoh Exp $
=end
require 'gettext/iconv'
class MOFile < Hash
@@ -102,11 +102,11 @@
clear
for i in 0...header.nstrings
io.pos = trans_table_data[i * 2 + 1]
str = io.read(trans_table_data[i * 2 + 0])
- if original_strings[i] == ""
+ if (! original_strings[i]) || original_strings[i] == ""
if str
@charset = nil
@nplurals = nil
@plural = nil
str.each_line{|line|
@@ -122,10 +122,10 @@
@plural = "0" unless @plural
end
else
if @output_charset
begin
- str = Iconv.iconv(@output_charset, @charset, str).join if @charset
+ str = Iconv.conv(@output_charset, @charset, str) if @charset
rescue Iconv::Failure
if $DEBUG
$stderr.print "@charset = ", @charset, "\n"
$stderr.print "@output_charset = ", @output_charset, "\n"
$stderr.print "msgid = ", original_strings[i], "\n"