From: <nul...@cl...> - 2011-04-25 21:46:06
|
Kakutani Shintaro 2011-04-25 15:32:26 +0000 (Mon, 25 Apr 2011) New Revision: c4d96c904977878671073a4229166a7bf278f06e Merged 286f056: Merged pull request #27 from kakutani/en_shorten_utf8. Log: diary/lang/en.rb: add utf-8 option on regexp. Modified files: tdiary/lang/en.rb Modified: tdiary/lang/en.rb (+1 -1) =================================================================== --- tdiary/lang/en.rb 2011-04-25 04:09:31 +0000 (3c5418c) +++ tdiary/lang/en.rb 2011-04-25 15:32:26 +0000 (b6c8bc3) @@ -63,7 +63,7 @@ end # 'shorten' method cuts string length. # def shorten( str, length = 120 ) - matched = str.gsub( /\n/, ' ' ).scan( /^.{0,#{length - 2}}/ )[0] + matched = str.gsub( /\n/, ' ' ).scan( /^.{0,#{length - 2}}/u )[0] unless $'.empty? matched + '..' else |