From: Yusuke Endoh Date: 2009-08-18T23:23:57+09:00 Subject: [ruby-core:24966] [Bug #1943](Rejected) unexpected behavior of tr with unicode strings Issue #1943 has been updated by Yusuke Endoh. Status changed from Open to Rejected Not a bug. By design, String#tr handles some meta characters including '-' (ASCII 45). What you are doing is similar to: "F@@@@F".tr("ABCDEF", "abcd-a") #=> "d@@@@d" "F".tr("F", "a") #=> "a@@@@a" You should use escape character: "F@@@@F".tr("ABCDEF", "abcd\-a") #=> "a@@@@a" BTW, in a discussion with nurse, we noticed that empty range (such as "d-a") seems to cause unexpected behavior. I'll register a separate ticket. -- Yusuke ENDOH ---------------------------------------- http://redmine.ruby-lang.org/issues/show/1943 ---------------------------------------- http://redmine.ruby-lang.org