diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-12 17:30:07 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-12 17:30:07 +0000 |
commit | 41d3a0148637725fc6078b4bdfadae290ff0d39e (patch) | |
tree | 3a6fb7c25fd178d17d8bb9836f109c23c8eefdab | |
parent | 248acf0025f047a731b6d6967382ce9b7675a05e (diff) | |
download | ruby-41d3a0148637725fc6078b4bdfadae290ff0d39e.tar.gz |
* enc/trans/escape.trans: transcoder name renamed to use underscore.
* transcode.c: follow the renaming.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | enc/trans/escape.trans | 8 | ||||
-rw-r--r-- | test/ruby/test_econv.rb | 22 | ||||
-rw-r--r-- | transcode.c | 18 |
4 files changed, 30 insertions, 24 deletions
@@ -1,3 +1,9 @@ +Sat Sep 13 02:29:19 2008 Tanaka Akira <akr@fsij.org> + + * enc/trans/escape.trans: transcoder name renamed to use underscore. + + * transcode.c: follow the renaming. + Sat Sep 13 02:12:17 2008 Tanaka Akira <akr@fsij.org> * transcode.c (rb_econv_init_by_convpath_i): new function. diff --git a/enc/trans/escape.trans b/enc/trans/escape.trans index 63836c37a6..df4347cda6 100644 --- a/enc/trans/escape.trans +++ b/enc/trans/escape.trans @@ -5,19 +5,19 @@ str.unpack("H*")[0] end - transcode_tblgen("", "amp-escaped", [ + transcode_tblgen("", "amp_escape", [ ["{00-25,27-FF}", :nomap], ["26", hexstr("&")] ]) - transcode_tblgen("", "xml-text-escaped", [ + transcode_tblgen("", "xml_text_escape", [ ["{00-25,27-3B,3D,3F-FF}", :nomap], ["26", hexstr("&")], ["3C", hexstr("<")], ["3E", hexstr(">")] ]) - transcode_tblgen("", "xml-attr-content-escaped", [ + transcode_tblgen("", "xml_attr_content_escape", [ ["{00-21,23-25,27-3B,3D,3F-FF}", :nomap], ["22", hexstr(""")], ["26", hexstr("&")], @@ -74,7 +74,7 @@ escape_xml_attr_quote_finish(void *statep, unsigned char *o) static const rb_transcoder rb_escape_xml_attr_quote = { - "", "xml-attr-quoted", escape_xml_attr_quote, + "", "xml_attr_quote", escape_xml_attr_quote, TRANSCODE_TABLE_INFO, 1, /* input_unit_length */ 1, /* max_input */ diff --git a/test/ruby/test_econv.rb b/test/ruby/test_econv.rb index c1e78e54a7..4ea2475da0 100644 --- a/test/ruby/test_econv.rb +++ b/test/ruby/test_econv.rb @@ -37,7 +37,7 @@ class TestEncodingConverter < Test::Unit::TestCase assert_nil(Encoding::Converter.asciicompat_encoding("EUC-JP")) assert_nil(Encoding::Converter.asciicompat_encoding("UTF-8")) assert_nil(Encoding::Converter.asciicompat_encoding(Encoding::UTF_8)) - assert_nil(Encoding::Converter.asciicompat_encoding("xml-attr-escaped")) + assert_nil(Encoding::Converter.asciicompat_encoding("xml_attr_escape")) assert_nil(Encoding::Converter.asciicompat_encoding("encoding-not-exist")) end @@ -755,45 +755,45 @@ class TestEncodingConverter < Test::Unit::TestCase end def test_xml_escape_text - ec = Encoding::Converter.new("", "amp-escaped") + ec = Encoding::Converter.new("", "amp_escape") assert_equal('&<>"', ec.convert("&<>\"")) assert_equal('', ec.finish) - ec = Encoding::Converter.new("", "xml-text-escaped") + ec = Encoding::Converter.new("", "xml_text_escape") assert_equal('&<>"', ec.convert("&<>\"")) assert_equal('', ec.finish) end def test_xml_escape_attr_content - ec = Encoding::Converter.new("", "xml-attr-content-escaped") + ec = Encoding::Converter.new("", "xml_attr_content_escape") assert_equal('', ec.finish) - ec = Encoding::Converter.new("", "xml-attr-content-escaped") + ec = Encoding::Converter.new("", "xml_attr_content_escape") assert_equal('', ec.convert("")) assert_equal('', ec.finish) - ec = Encoding::Converter.new("", "xml-attr-content-escaped") + ec = Encoding::Converter.new("", "xml_attr_content_escape") assert_equal('"', ec.convert('"')) assert_equal('', ec.finish) - ec = Encoding::Converter.new("", "xml-attr-content-escaped") + ec = Encoding::Converter.new("", "xml_attr_content_escape") assert_equal('&<>"', ec.convert("&<>\"")) assert_equal('', ec.finish) end def test_xml_escape_attr_quote - ec = Encoding::Converter.new("", "xml-attr-quoted") + ec = Encoding::Converter.new("", "xml_attr_quote") assert_equal('""', ec.finish) - ec = Encoding::Converter.new("", "xml-attr-quoted") + ec = Encoding::Converter.new("", "xml_attr_quote") assert_equal('', ec.convert("")) assert_equal('""', ec.finish) - ec = Encoding::Converter.new("", "xml-attr-quoted") + ec = Encoding::Converter.new("", "xml_attr_quote") assert_equal('""', ec.convert('"')) assert_equal('"', ec.finish) - ec = Encoding::Converter.new("", "xml-attr-quoted") + ec = Encoding::Converter.new("", "xml_attr_quote") assert_equal('"&<>"', ec.convert("&<>\"")) assert_equal('"', ec.finish) end diff --git a/transcode.c b/transcode.c index 25b744747c..3dfca27d01 100644 --- a/transcode.c +++ b/transcode.c @@ -970,11 +970,11 @@ decorator_names(int ecflags, const char **decorators_ret) num_decorators = 0; if (ecflags & ECONV_XML_TEXT_DECORATOR) - decorators_ret[num_decorators++] = "xml-text-escaped"; + decorators_ret[num_decorators++] = "xml_text_escape"; if (ecflags & ECONV_XML_ATTR_CONTENT_DECORATOR) - decorators_ret[num_decorators++] = "xml-attr-content-escaped"; + decorators_ret[num_decorators++] = "xml_attr_content_escape"; if (ecflags & ECONV_XML_ATTR_QUOTE_DECORATOR) - decorators_ret[num_decorators++] = "xml-attr-quoted"; + decorators_ret[num_decorators++] = "xml_attr_quote"; if (ecflags & ECONV_CRLF_NEWLINE_DECORATOR) decorators_ret[num_decorators++] = "crlf_newline"; @@ -1905,27 +1905,27 @@ econv_description(const char *sname, const char *dname, int ecflags, VALUE mesg) rb_str_cat2(mesg, " with "); if (ecflags & ECONV_UNIVERSAL_NEWLINE_DECORATOR) { rb_str_cat2(mesg, pre); pre = ","; - rb_str_cat2(mesg, "universal-newline"); + rb_str_cat2(mesg, "universal_newline"); } if (ecflags & ECONV_CRLF_NEWLINE_DECORATOR) { rb_str_cat2(mesg, pre); pre = ","; - rb_str_cat2(mesg, "CRLF-newline"); + rb_str_cat2(mesg, "crlf_newline"); } if (ecflags & ECONV_CR_NEWLINE_DECORATOR) { rb_str_cat2(mesg, pre); pre = ","; - rb_str_cat2(mesg, "CR-newline"); + rb_str_cat2(mesg, "cr_newline"); } if (ecflags & ECONV_XML_TEXT_DECORATOR) { rb_str_cat2(mesg, pre); pre = ","; - rb_str_cat2(mesg, "XML-text"); + rb_str_cat2(mesg, "xml_text"); } if (ecflags & ECONV_XML_ATTR_CONTENT_DECORATOR) { rb_str_cat2(mesg, pre); pre = ","; - rb_str_cat2(mesg, "XML-attr-content"); + rb_str_cat2(mesg, "xml_attr_content"); } if (ecflags & ECONV_XML_ATTR_QUOTE_DECORATOR) { rb_str_cat2(mesg, pre); pre = ","; - rb_str_cat2(mesg, "XML-attr-quote"); + rb_str_cat2(mesg, "xml_attr_quote"); } has_description = 1; } |