source: extensions/gsdl-video/trunk/installed/cmdline/lib/ruby/1.8/rexml/encodings/EUC-JP.rb@ 18425

Last change on this file since 18425 was 18425, checked in by davidb, 15 years ago

Video extension to Greenstone

File size: 595 bytes
Line 
1module REXML
2 module Encoding
3 begin
4 require 'uconv'
5
6 def decode_eucjp(str)
7 Uconv::euctou8(str)
8 end
9
10 def encode_eucjp content
11 Uconv::u8toeuc(content)
12 end
13 rescue LoadError
14 require 'nkf'
15
16 EUCTOU8 = '-Ewm0'
17 U8TOEUC = '-Wem0'
18
19 def decode_eucjp(str)
20 NKF.nkf(EUCTOU8, str)
21 end
22
23 def encode_eucjp content
24 NKF.nkf(U8TOEUC, content)
25 end
26 end
27
28 register("EUC-JP") do |obj|
29 class << obj
30 alias decode decode_eucjp
31 alias encode encode_eucjp
32 end
33 end
34 end
35end
Note: See TracBrowser for help on using the repository browser.