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