Purify Categories

Apply the same methodology, as in Revision 432,
to the category chunk-handler. This completes
the replacement of all the code that looks like

  if string.is_utf8?
    do something
  else
    complain
  end

with code that looks like

  string.purify
  do something
This commit is contained in:
Jacques Distler 2009-09-07 20:38:09 -05:00
parent c79fef9c01
commit 116255dc0d
3 changed files with 14 additions and 2 deletions

View file

@ -31,7 +31,7 @@ class String
| \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3
| [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15
| \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16
)+\Z/nx;
)*\Z/nx;
#++
# Check whether a string is valid utf-8