1 # Copyright (C) 2002-2004 Kouichirou Eto, All rights reserved.
3 require "chise/character"
7 # copied from htree/encoder.rb
10 |[\xc0-\xdf][\x80-\xbf]
11 |[\xe0-\xef][\x80-\xbf][\x80-\xbf]
12 |[\xf0-\xf7][\x80-\xbf][\x80-\xbf][\x80-\xbf]
13 |[\xf8-\xfb][\x80-\xbf][\x80-\xbf][\x80-\xbf][\x80-\xbf]
14 |[\xfc-\xfd][\x80-\xbf][\x80-\xbf][\x80-\xbf][\x80-\xbf][\x80-\xbf])\Z/nx
16 def is_a_utf8? # Is this string one character in UTF-8?
17 (UTF8_RE =~ self) != nil
21 raise unless is_a_utf8?
22 CHISE::Character.get("?"+self)
25 def method_missing(mid, *args)
26 char.method_missing(mid, *args)
40 pa = CHISE::EntityReferenceParser.new