mirror of
https://github.com/ruby/ruby.git
synced 2025-08-28 15:36:16 +02:00
merge r23443.
* sample/rss/rss_recent.rb, sample/rss/list_description.rb: use UTF-8. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
69721fccb7
commit
da03c91a67
3 changed files with 9 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Sat May 16 19:35:48 2009 Kouhei Sutou <kou@cozmixng.org>
|
||||||
|
|
||||||
|
* sample/rss/rss_recent.rb, sample/rss/list_description.rb: use
|
||||||
|
UTF-8.
|
||||||
|
|
||||||
Sat May 16 19:34:09 2009 Kouhei Sutou <kou@cozmixng.org>
|
Sat May 16 19:34:09 2009 Kouhei Sutou <kou@cozmixng.org>
|
||||||
|
|
||||||
* lib/rss/rss.rb, test/rss/test_version.rb (RSS::VERSION):
|
* lib/rss/rss.rb, test/rss/test_version.rb (RSS::VERSION):
|
||||||
|
|
|
@ -4,7 +4,7 @@ require "nkf"
|
||||||
class String
|
class String
|
||||||
# From tdiary.rb
|
# From tdiary.rb
|
||||||
def shorten( len = 120 )
|
def shorten( len = 120 )
|
||||||
lines = NKF::nkf( "-e -m0 -f#{len}", self.gsub( /\n/, ' ' ) ).split( /\n/ )
|
lines = NKF::nkf( "-t -m0 -f#{len}", self.gsub( /\n/, ' ' ) ).split( /\n/ )
|
||||||
lines[0].concat( '...' ) if lines[0] and lines[1]
|
lines[0].concat( '...' ) if lines[0] and lines[1]
|
||||||
lines[0]
|
lines[0]
|
||||||
end
|
end
|
||||||
|
@ -52,7 +52,7 @@ ARGV.each do |fname|
|
||||||
puts "#{fname} does not include RSS 1.0 or 0.9x/2.0"
|
puts "#{fname} does not include RSS 1.0 or 0.9x/2.0"
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
rss.output_encoding = "euc-jp"
|
rss.output_encoding = "utf-8"
|
||||||
rescue RSS::UnknownConversionMethodError
|
rescue RSS::UnknownConversionMethodError
|
||||||
error($!) if verbose
|
error($!) if verbose
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,7 +4,7 @@ require "nkf"
|
||||||
class String
|
class String
|
||||||
# From tdiary.rb
|
# From tdiary.rb
|
||||||
def shorten( len = 120 )
|
def shorten( len = 120 )
|
||||||
lines = NKF::nkf( "-e -m0 -f#{len}", self.gsub( /\n/, ' ' ) ).split( /\n/ )
|
lines = NKF::nkf( "-t -m0 -f#{len}", self.gsub( /\n/, ' ' ) ).split( /\n/ )
|
||||||
lines[0].concat( '...' ) if lines[0] and lines[1]
|
lines[0].concat( '...' ) if lines[0] and lines[1]
|
||||||
lines[0]
|
lines[0]
|
||||||
end
|
end
|
||||||
|
@ -51,7 +51,7 @@ ARGV.each do |fname|
|
||||||
puts "#{fname} does not include RSS 1.0 or 0.9x/2.0"
|
puts "#{fname} does not include RSS 1.0 or 0.9x/2.0"
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
rss.output_encoding = "euc-jp"
|
rss.output_encoding = "utf-8"
|
||||||
rescue RSS::UnknownConversionMethodError
|
rescue RSS::UnknownConversionMethodError
|
||||||
error($!) if verbose
|
error($!) if verbose
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue