Project

General

Profile

Actions

Backport #4018

closed

String#<< can result in string that lies about String#valid_encoding?

Added by ender672 (Timothy Elliott) over 13 years ago. Updated over 11 years ago.

Status:
Closed
[ruby-core:33027]

Description

=begin
s1 = "aa".force_encoding("utf-16be")
s2 = "\xFF".force_encoding("utf-16be")
s1.valid_encoding?
s1 << s2

s1.valid_encoding? # => true
s1.length
s1.valid_encoding? # => false

This issue only happens with UTF-16BE/LE and UTF-32BE/LE. It also only happens if you call String#valid_encoding? before concat with the second string.
=end

Actions #1

Updated by nobu (Nobuyoshi Nakada) over 13 years ago

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

=begin
This issue was solved with changeset r29676.
Timothy, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Actions #2

Updated by nobu (Nobuyoshi Nakada) over 13 years ago

  • Category set to M17N
  • Status changed from Closed to Assigned
  • Assignee set to yugui (Yuki Sonoda)

=begin

=end

Actions #3

Updated by yugui (Yuki Sonoda) over 13 years ago

  • Status changed from Assigned to Closed

=begin
This issue was solved with changeset r30132.
Timothy, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0