diff --git a/doc/string/scrub.rdoc b/doc/string/scrub.rdoc index 5ace376cdbec85..314b28c465c580 100644 --- a/doc/string/scrub.rdoc +++ b/doc/string/scrub.rdoc @@ -5,7 +5,7 @@ With no block given, replaces each invalid sequence with the given +default_replacement_string+ (by default, "�" for a Unicode encoding, '?' otherwise): - "foo\x81\x81bar"scrub # => "foo��bar" + "foo\x81\x81bar".scrub # => "foo��bar" "foo\x81\x81bar".force_encoding('US-ASCII').scrub # => "foo??bar" "foo\x81\x81bar".scrub('xyzzy') # => "fooxyzzyxyzzybar" diff --git a/internal/string.h b/internal/string.h index 9212ce898653be..02e708d34180ff 100644 --- a/internal/string.h +++ b/internal/string.h @@ -38,7 +38,7 @@ rb_str_encindex_fastpath(int encindex) // Hence you can use fast, single byte algorithms on them, such as `memchr` etc, // without all the overhead of fetching the rb_encoding and using functions such as // rb_enc_mbminlen etc. - // Many other encodings could qualify, but they are expected to be rare occurences, + // Many other encodings could qualify, but they are expected to be rare occurrences, // so it's better to keep that list small. switch (encindex) { case ENCINDEX_ASCII_8BIT: