Project

General

Profile

Actions

Backport #3747

closed

Possible bug of String#count?

Added by lirh (Ruohao Li) over 13 years ago. Updated about 13 years ago.

Status:
Closed
[ruby-core:31851]

Description

=begin
$ ruby -v
ruby 1.9.1p429 (2010-07-02 revision 28523) [i386-darwin9]
$ cat c.rb

-- coding: utf-8 --

s = "a\u3042" # \u3042 is the japanese hiragana "a"
puts s.encoding.name
puts s.count("^a")
$ ruby c.rb
UTF-8
0

The result of count method should be 1 but is 0.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0