Project

General

Profile

Actions

Bug #1839

closed

String#tr borked for UTF-8 0080..00FF

Added by candlerb (Brian Candler) over 14 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.8.6 (2007-09-24 patchlevel 111) [i486-linux]
Backport:
[ruby-core:24612]

Description

=begin

a = "uber"
=> "uber"
a.encoding
=> #Encoding:UTF-8
b = a.tr("u","ü")
=> "\xFCber"
b.encoding
=> #Encoding:UTF-8

What's more remarkable,

b.valid_encoding?
=> true

!!!

b << "x"
=> "\xFCberx"
b.valid_encoding?
=> true

!!!

And yet it works for codepoints > 255:

c = a.tr("u","ł")
=> "łber"
c.encoding
=> #Encoding:UTF-8

=end

Actions #1

Updated by candlerb (Brian Candler) over 14 years ago

=begin
Oops, I pasted ruby -v instead of ruby19 -v. The correct version is:

ruby 1.9.2dev (2009-07-18 trunk 24186) [i686-linux]

=end

Actions #2

Updated by naruse (Yui NARUSE) over 14 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r24342.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0