diff options
| author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-17 12:19:53 +0000 |
|---|---|---|
| committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-17 12:19:53 +0000 |
| commit | 26ac59cd44b75af453d0aa0f9a9c03baf171bc02 (patch) | |
| tree | e3d608325be62ae139a942bc0bdd72a86678f07e | |
| parent | d7bd3d54f75d24905a44655f750de57964ab58a1 (diff) | |
| download | ruby-26ac59cd44b75af453d0aa0f9a9c03baf171bc02.tar.gz ruby-26ac59cd44b75af453d0aa0f9a9c03baf171bc02.tar.xz ruby-26ac59cd44b75af453d0aa0f9a9c03baf171bc02.zip | |
merges r21625 from trunk into ruby_1_9_1.
* lib/irb/xmp.rb: multilingualizes XMP::StringInputMethod.
[ruby-core:21383].
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@21633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | lib/irb/xmp.rb | 12 |
2 files changed, 17 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Sat Jan 17 17:58:22 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp> + + * lib/irb/xmp.rb: multilingualizes XMP::StringInputMethod. + [ruby-core:21383]. + Sat Jan 17 11:12:21 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> * vm_dump.c (vm_stack_dump_each): initialized at declarations. diff --git a/lib/irb/xmp.rb b/lib/irb/xmp.rb index 851852cd3..af87b4888 100644 --- a/lib/irb/xmp.rb +++ b/lib/irb/xmp.rb @@ -72,8 +72,20 @@ class XMP end def puts(exps) + if @encoding and exps.encoding != @encoding + enc = Encoding.compatible?(@exps.join("\n"), exps) + if enc.nil? + raise Encoding::CompatibilityError, "Encoding in which the passed exression is encoded is not compatible to the preceding's one" + else + @encoding = enc + end + else + @encoding = exps.encoding + end @exps.concat exps.split(/\n/) end + + attr_reader :encoding end end |
