summaryrefslogtreecommitdiffstats
path: root/lib/rexml/encodings
Commit message (Collapse)AuthorAgeFilesLines
* * lib/rexml/encodings/SHIFT-JIS.rb (REXML::Encoding): place -x formatz2007-11-061-2/+2
| | | | | | | nkf conversion. a patch from <moonwolf AT moonwolf.com>. [ruby-dev:32183] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* r1361@bean: ser | 2007-10-01 21:24:28 -0400ser2007-10-021-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/encodings/{ISO-8859-15,CP-1252}.rb: fixed invalid syntax.nobu2007-08-062-80/+80
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12883 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merges upstream changes for REXML v3.1.7ser2007-07-252-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://www.germane-software.com/repos/rexml/tags/3.1.7 r1278@bean: ser | 2007-06-07 00:53:06 -0400 Fixed a double-encoding bug. This was a regression, related to ticket:48. r1292@bean: ser | 2007-07-25 08:19:36 -0400 r1279@bean: ser | 2007-06-09 23:19:02 -0400 Fixes ticket:89 -- encoding CP-1252 was broken. ISO-8859-15 had the same problem. Also in this patch is a fix to merge.rb (unused, but it should at least contain no errors), and a unit test for ticket:88. r1293@bean: ser | 2007-07-25 08:19:37 -0400 r1281@bean: ser | 2007-07-24 11:08:48 -0400 Addresses ticket:85 This is a major rewrite of the XML formatting code. The XML writers have all been extracted out of the classes and put into their own class containers. This makes writing parsers easier, and cleaner. There are three formatters, which correspond to the previous three XML writing modes: REXML::Formatters::Default Prints the XML document exactly as it was parsed REXML::Formatters::Pretty Pretty prints the XML document, destroying whitespace in the document REXML::Formatters::Transitive Pretty prints the XML document, preserving whitespace All of the write() functions have been deprecated (some are still used, but these will also go away) except the write() function on Document, which is left for convenience. To pretty print an XML document the canonical way: formatter = REXML::Formatters::Pretty.new( 5 ) # indent by 5 spaces formatter.write( document, output ) r1294@bean: ser | 2007-07-25 08:19:38 -0400 r1283@bean: ser | 2007-07-24 19:53:30 -0400 This goes with the previous commit. r1295@bean: ser | 2007-07-25 08:19:39 -0400 r1285@bean: ser | 2007-07-24 20:02:07 -0400 And THIS goes with the previous two patches. Dammit. r1296@bean: ser | 2007-07-25 08:19:40 -0400 r1287@bean: ser | 2007-07-24 20:12:25 -0400 Applied patch from Jeff Barczewski. Note that this changes what the values of the name and IDs are from the previous behavior -- the values no longer include the quotes. This is the correct behavior, so I'm leaving it in, but it is not backwards compatible. Also fixes the serializer so that it outputs the doctype in a correct format (needed as a result of this change). r1297@bean: ser | 2007-07-25 08:38:38 -0400 Version update git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merged from REXML main repository:ser2007-01-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes ticket:68. NOTE that this involves an API change! Entity declarations in the doctype now generate events that carry two, not one, arguments. Implements ticket:15, using gwrite's suggestion. This allows Element to be subclassed. Two unrelated changes, because subversion is retarded and doesn't do block-level commits: 1) Fixed a typo bug in previous change for ticket:15 2) Fixed namespaces handling in XPath and element. ***** Note that this is an API change!!! ***** Element.namespaces() now returns a hash of namespace mappings which are relevant for that node. Fixes a bug in multiple decodings The changeset 1230:1231 was bad. The default behavior is *not* to use the native REXML encodings by default, but rather to use ICONV by default. I know that this will piss some people off, but defaulting to the pure Ruby version isn't the correct solution, and it breaks other encodings, so I've reverted it. * Fixes ticket:61 (xpath_parser) * Fixes ticket:63 (UTF-16; UNILE decoding was bad) * Cleans up some tests, removing opportunities for test corruption * Improves parsing error messages a little * Adds the ability to override the encoding detection in Source construction * Fixes an edge case in Functions::string, where document nodes weren't correctly converted * Fixes Functions::string() for Element and Document nodes * Fixes some problems in entity handling Addresses ticket:66 Fixes ticket:71 Addresses ticket:78 NOTE: that this also fixes what is technically another bug in REXML. REXML's XPath parser used to allow exponential notation in numbers. The XPath spec is specific about what a number is, and scientific notation is not included. Therefore, this has been fixed. Cross-ported a fix for ticket:88 from CVS. Fixes ticket:80 Documentation cleanup. Ticket:84 Applied Kou's fix for an un-trac'ed bug. ------------------------------------------------------------------------ git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@11548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (rb_hash_compare_by_identity): rename Hash#identical tomatz2006-09-131-1/+1
| | | | | | | Hash#compare_by_identity. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/source.rb (REXML::Source::encoding): should notmatz2006-09-111-1/+2
| | | | | | | | | | | | | | | | | | convert the body twice. [ruby-core:08828] * lib/rexml/encoding.rb (REXML::Encoding::encoding): Encoding#encoding= to return boolean value to tell if the body is really converted or not. * lib/rexml/encoding.rb (REXML::Encoding::encoding): Specific conversion library (e.g. rexml/encodings/UTF-16.rb) to have higher preceding. * lib/rexml/encodings/UTF-16.rb (REXML::Encoding::decode_utf16): UTF-16#decode_utf16 should work strings without BOM. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/encoding.rb (encoding=): give priority to particularnobu2005-12-093-15/+45
| | | | | | | conversion to iconv. [ruby-core:06520] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@9661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/encodings/SHIFT-JIS.rb: encoding and decoding wereocean2005-04-251-2/+2
| | | | | | | | | swapped. [ruby-core:4772] (patch from speakillof) * lib/rexml/encoding.rb: fixed indentation. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@8385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Applied Nobu's patch to the XML document encoding structure in REXML. Itser2005-04-098-101/+77
| | | | | | | | passes all of REXML's native tests as well as a couple of others, and should fix potential threading issues. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@8293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/encodings/SHIFT_JIS.rb: fixed LoadError bug. [ruby-core:3958]kou2004-12-191-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merged in the changes from BSD bug report. shift-jis is now shift_jis, inser2004-12-132-5/+5
| | | | | | | accordance with IANA git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Added support for CP-1252 and ISO-8859-15 encodings for non-iconv systems.ser2004-05-162-0/+167
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ------------------------------------------------------------------------ser2004-05-161-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* REXML changesser2004-04-021-1/+1
| | | | | | | | | | | | | | | * The main purpose for this change is to get a fix in for nasty bug in XPath. In the new code for the descendant-or-self axis, the document order code was calling the wrong method to do node comparisons, causing a terrible overhead that slowed the axis down to the point where it was unusable. This is a common axis, also known as '//', so this fix is critical. * Using Element#text= on a non-Text, non-String argument caused an error. This has been changed so that the behavior is like puts() -- to_s() is called on the object first. * Refactored the pretty-printing code a little. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/encodings/SHIFT_JIS: wrong library name.nobu2004-02-161-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fixed Issue7: DocType with external IDs was not being quoted.ser2004-02-161-33/+1
| | | | | | | SHIFT_JIS now merely includes Shift-JIS git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* @@ Fix for the XPath descendant* result set ordering bug @@ser2004-02-132-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | @@ SAX2 listener bug fixes @@ @@ Undid a code change that caused a 10x speed regression @@ @@ Indentation fixes, and a new word wrapping feature for text nodes was contributed by Devin Bayer (documentation forthcoming; see the change logs for now) @@ The XPath bug fix is really ugly and inefficient, but I spent two days hacking at it and this was the best I could come up with. The SAX2 listener fixes had to do with crashes in certain conditions, like when there was a carriage return at the end of a document Several people submitted patches for the speed regression; it is embarrassing how long it took me to get around to looking at this. To this day, I don't know where the offending code came from. Encoding fixes Added a contributed word wrapping option for text formatting. Devin Bayer contributed this. Here's his comment: "Setting :wordwrapping to :all, wordwraps all text nodes longer than 60 characters. Setting :indentstyle to aString, make aString used as indentation, instead of the default ' '. And as long as :respect_whitespace isn't set for the element, multiline text nodes will be indented." git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * misc/ruby-mode.el: better support for general delimitedmatz2004-01-271-1/+1
| | | | | | | | | | | | | | | | strings. [ruby-dev:22695] * lib/weakref.rb (WeakRef::initialize): set up @__id before calling "super". * lib/delegate.rb (Delegator::initialize): preserve singleton_method_added method [ruby-dev:22685] * lib/delegate.rb (Delegator::initialize): use Kernel::raise instead of mere raise. [ruby-dev:22681] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Commit miss?usa2003-12-231-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * pack.c (pack_pack): remove unnecessary negative value check.matz2003-12-231-1/+1
| | | | | | | | | | [ruby-dev:22329] * io.c (rb_io_ungetc): need fflush before ungetc if write buffer is filled. [ruby-dev:22330] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/encodings/US-ASCII.rb: typo. [ruby-talk:88650]nahi2003-12-231-1/+1
| | | | | | | | | | * test/ruby/test_system.rb: num of asserts depended on running dir. * test/xsd/test_noencoding.rb: rexml + without iconv/uconv cannot handle euc-jp. install iconv, uconv or xmlscan. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* REXML changes:ser2003-12-126-42/+40
| | | | | | | | | * Took out the duplicate Shift-JIS entries, for OSes that don't understand case sensitive file names. * Fixed some bugs in the encodings git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Added downcased shift-jis declarations. The old, all upper case declarationsser2003-12-092-0/+38
| | | | | | | | are deprecated, but I need some Shift-JIS encoded documents to test against before I remove them. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * Added the lower-case Shift-JIS files to the manifest. The upper-case onesser2003-12-097-126/+143
| | | | | | | | | | | | | | | | | should be deprecated, but I need a Shift-JIS encoded XML file to test against, first. * Added support for maintaining external entity occurances in DTDs * Deprecated the use of Document::DECLARATION. The new default declaration can be gotten with XMLDecl::default() * Refactored the encoding support code. It should be more robust now, and fixes a few bugs. * The XPath string() function now deals with Element nodes properly. * Serialization with Output objects now works as would be expected. * Various code cleanups, some reducing the number of warnings that Ruby 1.8.x produces with REXML. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * Changes to the encoding mechanism. If iconv is found, it is used firstser2003-10-1013-56/+45
| | | | | | | | | | | | | | | | for encoding changes. This should be the case on all 1.8 installations. When it isn't found (<1.6), the native REXML encoding mechanism is used. This cleaned out some files, and tightened up the code a bit; and iconv should be faster than the pure Ruby code. * Changed deprecated assert_not_nil to assert throughout the tests. * Parse exceptions are a little more verbose, and extend RuntimeError. * Bug fixes to XPathParser * The Light API is still shifting, like the sands of the desert. * Fixed a new Ruby 1.8.0 warning, added some speed optimizations, and tightened error reporting in the base parser git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (ruby_init): set ruby_running to true aftermatz2003-07-172-3/+19
| | | | | | | initialization. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * rename 'Shift-JIS' to 'SHIFT-JIS'matz2003-07-114-33/+18
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/encodings/EUC-JP.rb (Encoding): use join.matz2003-07-102-4/+4
| | | | | | | | * lib/rexml/encodings/Shift-JIS.rb (Encoding): use join, and typo fixed. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_load): put rb_load_file() in a thread criticalmatz2003-07-093-21/+35
| | | | | | | | | | | | | | | | | | | | | | | | section. [ruby-dev:20490] * eval.c (compile): put rb_compile_string() in a thread critical section. * variable.c (rb_const_get_0): should not warn if constant is not defined. (ruby-bugs-ja PR#509) * bignum.c (rb_big2dbl): give a warning on overflow. (ruby-bugs-ja PR#510) * util.c (ruby_strtod): change MDMAXEXPT from 511 to 308. * pack.c (utf8_to_uv): long is sufficient. LONG_LONG is not required. * bignum.c (rb_big2str): support 32 bit (without `long long' type) machines. (ruby-bugs-ja PR#512) git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Initial revisionser2003-06-1013-0/+187
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e