[ruby-core:79279] [Ruby trunk Bug#13162] tr does not recognize multi-byte characters correctly

From: sawadatsuyoshi@...
Date: 2017-01-27 05:33:47 UTC
List: ruby-core #79279
Issue #13162 has been reported by Tsuyoshi Sawada.

----------------------------------------
Bug #13162: tr does not recognize multi-byte characters correctly
https://bugs.ruby-lang.org/issues/13162

* Author: Tsuyoshi Sawada
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 2.3.3
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
This looks as expected:

```
"\\".tr('\\', '\') # => "\"
```

but this doesn't:


```
"\\".tr("\\¥'", "\¥'") # => "\\"
```

I confirmed the strings are UTF-8.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next