REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 2.25 KB
Close
/proc/thread-self/root/opt/alt/ruby18/lib64/ruby/1.8/rexml/encodings/ISO-8859-15.rb
Text
Base64
# # This class was contributed by Mikko Tiihonen mikko DOT tiihonen AT hut DOT fi # module REXML module Encoding register("ISO-8859-15") do |o| alias encode to_iso_8859_15 alias decode from_iso_8859_15 end # Convert from UTF-8 def to_iso_8859_15(content) array_utf8 = content.unpack('U*') array_enc = [] array_utf8.each do |num| case num # shortcut first bunch basic characters when 0..0xA3; array_enc << num # characters removed compared to iso-8859-1 when 0xA4; array_enc << '¤' when 0xA6; array_enc << '¦' when 0xA8; array_enc << '¨' when 0xB4; array_enc << '´' when 0xB8; array_enc << '¸' when 0xBC; array_enc << '¼' when 0xBD; array_enc << '½' when 0xBE; array_enc << '¾' # characters added compared to iso-8859-1 when 0x20AC; array_enc << 0xA4 # 0xe2 0x82 0xac when 0x0160; array_enc << 0xA6 # 0xc5 0xa0 when 0x0161; array_enc << 0xA8 # 0xc5 0xa1 when 0x017D; array_enc << 0xB4 # 0xc5 0xbd when 0x017E; array_enc << 0xB8 # 0xc5 0xbe when 0x0152; array_enc << 0xBC # 0xc5 0x92 when 0x0153; array_enc << 0xBD # 0xc5 0x93 when 0x0178; array_enc << 0xBE # 0xc5 0xb8 else # all remaining basic characters can be used directly if num <= 0xFF array_enc << num else # Numeric entity (&#nnnn;); shard by Stefan Scholl array_enc.concat "&\##{num};".unpack('C*') end end end array_enc.pack('C*') end # Convert to UTF-8 def from_iso_8859_15(str) array_latin9 = str.unpack('C*') array_enc = [] array_latin9.each do |num| case num # characters that differ compared to iso-8859-1 when 0xA4; array_enc << 0x20AC when 0xA6; array_enc << 0x0160 when 0xA8; array_enc << 0x0161 when 0xB4; array_enc << 0x017D when 0xB8; array_enc << 0x017E when 0xBC; array_enc << 0x0152 when 0xBD; array_enc << 0x0153 when 0xBE; array_enc << 0x0178 else array_enc << num end end array_enc.pack('U*') end end end
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 11
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
CP-1252.rb
4.04 KB
lrw-r--r--
2008-04-18 07:22:13
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
EUC-JP.rb
595 B
lrw-r--r--
2007-02-12 23:01:19
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ICONV.rb
433 B
lrw-r--r--
2007-02-12 23:01:19
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ISO-8859-1.rb
134 B
lrw-r--r--
2007-02-12 23:01:19
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ISO-8859-15.rb
2.25 KB
lrw-r--r--
2008-04-18 07:22:13
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
SHIFT-JIS.rb
647 B
lrw-r--r--
2007-11-06 18:37:49
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
SHIFT_JIS.rb
36 B
lrw-r--r--
2007-02-12 23:01:19
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
UNILE.rb
746 B
lrw-r--r--
2007-02-12 23:01:19
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
US-ASCII.rb
654 B
lrw-r--r--
2007-02-12 23:01:19
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
UTF-8.rb
268 B
lrw-r--r--
2007-02-12 23:01:19
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
UTF-16.rb
793 B
lrw-r--r--
2008-04-18 07:22:13
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).