xmlparser 0.6.81 → 0.7.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/MANIFEST +7 -68
- data/README +42 -39
- data/README.ja +54 -57
- data/ext/extconf.rb +58 -0
- data/ext/{xmlparser/xmlparser.c → xmlparser.c} +246 -180
- data/lib/xml/dom/digest.rb +37 -25
- data/lib/xml/dom2/domentityresolverimpl.rb +2 -13
- metadata +79 -93
- data/Rakefile +0 -34
- data/ext/xmlparser/mkrf_conf.rb +0 -28
- data/lib/xml/dom/builder-ja.rb +0 -58
- data/lib/xml/encoding-ja.rb +0 -42
data/lib/xml/encoding-ja.rb
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
## -*- Ruby -*-
|
2
|
-
## Sample XMLEncoding class for Japanese (EUC-JP, Shift_JIS)
|
3
|
-
## 1998 by yoshidam
|
4
|
-
##
|
5
|
-
## Usage:
|
6
|
-
## require 'xml/encoding-ja'
|
7
|
-
## include XML::Encoding_ja
|
8
|
-
|
9
|
-
module XML
|
10
|
-
module Encoding_ja
|
11
|
-
require 'xml/parser'
|
12
|
-
require 'uconv'
|
13
|
-
|
14
|
-
class EUCHandler<XML::Encoding
|
15
|
-
def map(i)
|
16
|
-
return i if i < 128
|
17
|
-
return -1 if i < 160 or i == 255
|
18
|
-
return -2
|
19
|
-
end
|
20
|
-
def convert(s)
|
21
|
-
Uconv.euctou2(s)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
class SJISHandler<XML::Encoding
|
26
|
-
def map(i)
|
27
|
-
return i if i < 128
|
28
|
-
return -2
|
29
|
-
end
|
30
|
-
def convert(s)
|
31
|
-
Uconv.sjistou2(s)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
def unknownEncoding(name)
|
36
|
-
return EUCHandler.new if name =~ /^euc-jp$/i
|
37
|
-
return SJISHandler.new if name =~ /^shift_jis$/i
|
38
|
-
nil
|
39
|
-
end
|
40
|
-
|
41
|
-
end
|
42
|
-
end
|