aboutsummaryrefslogtreecommitdiffstats
path: root/enc/trans/single_byte.trans
diff options
context:
space:
mode:
authorduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-14 04:37:10 +0000
committerduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-14 04:37:10 +0000
commit48a303c0277a8fd7c90fe0fd1cb4f908ab138e03 (patch)
tree9fe78ceaea538ae0c6f3cf8cf3f282a964425773 /enc/trans/single_byte.trans
parent9639bf54eceb04b5ff4f242681c2c03dd58e903b (diff)
downloadruby-48a303c0277a8fd7c90fe0fd1cb4f908ab138e03.tar.gz
* enc/trans/single_byte.trans: added windows-1252
* enc/trans/windows-1252-tbl.rb: new file (contributed by Yoshihiro Kambayashi) * tool/transcode-tblgen.rb: listed windows-1252 as '1byte' * test/ruby/test_transcode.rb: added test_windows_1252 (contributed by Yoshihiro Kambayashi) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enc/trans/single_byte.trans')
-rw-r--r--enc/trans/single_byte.trans11
1 files changed, 11 insertions, 0 deletions
diff --git a/enc/trans/single_byte.trans b/enc/trans/single_byte.trans
index 57254bf3d5..c33a850ad8 100644
--- a/enc/trans/single_byte.trans
+++ b/enc/trans/single_byte.trans
@@ -19,6 +19,7 @@
require 'iso-8859-13-tbl'
require 'iso-8859-14-tbl'
require 'iso-8859-15-tbl'
+ require 'windows-1252-tbl'
transcode_tblgen "US-ASCII", "UTF-8", us_ascii_map
transcode_tblgen "UTF-8", "US-ASCII", us_ascii_map
@@ -35,6 +36,15 @@
code
end
+ def transcode_tblgen_windows(name, tbl_to_ucs)
+ name_ident = name.tr('-','_')
+ code = ''
+ code << transcode_tblgen(name, "UTF-8", [["{00-7f}", :nomap], *tbl_to_ucs])
+ code << "\n"
+ code << transcode_tblgen("UTF-8", name, [["{00-7f}", :nomap], *tbl_to_ucs.map {|a,b| [b,a] }])
+ code
+ end
+
transcode_tblgen_iso8859("ISO-8859-1", ISO_8859_1_TO_UCS_TBL)
transcode_tblgen_iso8859("ISO-8859-2", ISO_8859_2_TO_UCS_TBL)
transcode_tblgen_iso8859("ISO-8859-3", ISO_8859_3_TO_UCS_TBL)
@@ -49,6 +59,7 @@
transcode_tblgen_iso8859("ISO-8859-13", ISO_8859_13_TO_UCS_TBL)
transcode_tblgen_iso8859("ISO-8859-14", ISO_8859_14_TO_UCS_TBL)
transcode_tblgen_iso8859("ISO-8859-15", ISO_8859_15_TO_UCS_TBL)
+ transcode_tblgen_windows("WINDOWS-1252", WINDOWS_1252_TO_UCS_TBL)
%>
<%= transcode_generated_code %>