summaryrefslogtreecommitdiffstats
path: root/transcode.c
Commit message (Collapse)AuthorAgeFilesLines
* stripped trailing spaces.nobu2009-02-221-10/+10
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (make_econv_exception): refine error message forakr2009-02-041-9/+19
| | | | | | | | undefined conversion. [ruby-core:21828] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (make_econv_exception): show U+XXXX form for undefinedakr2009-02-041-2/+16
| | | | | | | conversion error from UTF-8. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (rb_econv_init_by_convpath_i): make it static.akr2009-01-291-1/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21883 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (struct rb_transcoding): added ary member for debug.nobu2009-01-271-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (str_transcode0): fix: :xml option doesn'tnaruse2009-01-181-1/+2
| | | | | | work on str.encode([options]) form without default_internal. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add rdoc.naruse2009-01-151-1/+5
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enc/trans/gb18030.trans, gb18030-tbl.rb:duerst2009-01-141-4/+14
| | | | | | | | | | | | | | | new Chinese GB18030 transcoding (from Yoshihiro Kambayashi) * test/ruby/test_transcode.rb: added tests for the above (from Yoshihiro Kambayashi) * transcode_data.h, transcode.c, tool/transcode_tblgen.rb: added support for GB18030-specific 4-byte sequences (with Yoshihiro Kambayashi) git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add dummy definition for fake rdoc.naruse2009-01-131-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c: Minor fixes and tweaks in documentation.duerst2008-12-301-76/+85
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (make_econv_exception): show source and destinationakr2008-12-271-0/+8
| | | | | | | encoding. [ruby-dev:37285] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (fptr_finalize): close the IO object even if finish_writeconv orakr2008-12-261-0/+6
| | | | | | | | | | | | | | | flush is failed. (finish_writeconv): don't raise. return errno or exception. (finish_writeconv_arg): removed. (finish_writeconv_sync): follow finish_writeconv change. * transcode.c (rb_econv_make_exception): new function. * include/ruby/encoding.h (rb_econv_make_exception): declared. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (str_transcode0): set encoding when String#encode wasnaruse2008-12-251-2/+2
| | | | | | given explicit but the same destination and source encoding. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (sym_ignore): remove useless symbol.naruse2008-12-251-2/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (decorate_convpath): show type of escaping fornaruse2008-12-251-11/+16
| | | | | | xml_attr_quote or some conversions. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c: rdoc for File::open and 1.9 feature in file modes.yugui2008-12-231-2/+25
| | | | | | * transcode.c: rdoc for String#encode git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c: in transcode_search_path, elimintated a warningduerst2008-10-181-5/+2
| | | | | | | on cygwin about pathlen potentially not being initialized git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (str_transcode0): String#encode without argument nowmatz2008-10-171-16/+16
| | | | | | | | | behave as if :undef => :replace, :invalid => :replace specified. * transcode.c (rb_econv_prepare_opts): should preserve options in any case. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (transcode_restartable0): in_pos and out_pos never beakr2008-10-161-13/+0
| | | | | | | NULL, now. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (str_transcode0): should not raise error whenmatz2008-10-141-1/+1
| | | | | | default_internal is not set. [ruby-core:19309] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (rb_econv_init_by_convpath): suppressed warnings.nobu2008-10-131-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (str_transcode0): String#encode() with no encodingmatz2008-10-121-4/+15
| | | | | | | specified transcode the string into Encoding.default_internal. inspired by [ruby-core:19298]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (rb_econv_add_coverter): remove unnecessary NULL check.mame2008-10-091-2/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h (rb_str_encode): renamed fromakr2008-09-261-3/+3
| | | | | | | | | | | | | rb_str_transcode. [ruby-dev:36593] (rb_econv_has_convpath_p): renamed from rb_transcode_convertible. * transcode.c: follow the renaming. * io.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (Init_Exception): introduce EncodingError which is amatz2008-09-261-3/+3
| | | | | | | | | superclass for all encoding related exception classes, e.g. Encoding::CompatibilityError. [ruby-dev:36371] * transcode.c (Init_transcode): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c, include/ruby/encoding.c (rb_transcode_convertible):usa2008-09-261-0/+14
| | | | | | | | new function. checking the existance of converter. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update rdoc.akr2008-09-251-12/+12
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (rb_eUndefinedConversionError): renamed fromakr2008-09-251-18/+18
| | | | | | | | | rb_eConversionUndefinedError. (rb_eConverterNotFoundError): renamed from rb_eNoConverterError. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update rdoc.akr2008-09-251-10/+54
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update rdoc.akr2008-09-241-0/+5
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (enc_arg): must take pointer argument to avoid GCakr2008-09-181-8/+9
| | | | | | | | | | | | | | | | | | problem. StringValueCStr modifies the argument and it should be preserved while the string StringValueCStr returns is used. Since the string is used by caller, the modified argument should be hold by caller. Actually GC.stress = true def (o=Object.new).to_str() "universal"+"_newline" end "\u3042".encode(o, "")' causes curious warning: rb_define_const: invalid name `' for constant git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c: add "Error" suffix for Encoding exception classes.matz2008-09-181-41/+41
| | | | | | | | | | a patch from Tadashi Saito <shiba at mail2.accsnet.ne.jp> in [ruby-dev:36346]. * encoding.c (Init_Encoding): rename EncodingCompatibilityError to Encoding::CompatibilityError. [ruby-dev:36366] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (enc_arg): revert last change. too early exceptionmatz2008-09-181-9/+23
| | | | | | | | raising. * transcode.c (enc_arg): need not to take pointer argument. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (enc_arg): raise exception when unknown encoding isnaruse2008-09-161-18/+3
| | | | | | given. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode_data.h (STR1_LENGTH): defined.akr2008-09-151-4/+5
| | | | | | | | | | | | | | (makeSTR1LEN): defined. * tool/transcode-tblgen.rb: use makeSTR1LEN. generate STR1 for 4 to 259 bytes. * transcode.c (rb_transcoding): new field: output_index. (transcode_restartable0): use STR1_LENGTH. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (econv_opts): don't use to_sym.akr2008-09-151-2/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode_data.h: return output functions ssize_t.akr2008-09-141-6/+5
| | | | | | | | | | | | | | | | | | | * transcode.c (transcode_restartable0): don't need to cast the result of output functions. * enc/trans/newline.trans: follow the type change. * enc/trans/escape.trans: ditto. * enc/trans/utf_16_32.trans: ditto. * enc/trans/iso2022.trans: ditto. * enc/trans/japanese.trans: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode_data.h: output function takes output buffer size.akr2008-09-141-6/+20
| | | | | | | | | | | | | | | | | | * transcode.c: give output buffer size for output functions. * enc/trans/newline.trans: follow the type change. * enc/trans/escape.trans: ditto. * enc/trans/utf_16_32.trans: ditto. * enc/trans/iso2022.trans: ditto. * enc/trans/japanese.trans: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (str_encode): returns duplicated string if nothingnobu2008-09-141-1/+6
| | | | | | | changed. [ruby-core:18578] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (rb_transcoding): align state field.akr2008-09-131-5/+8
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (DECORATOR_P): renamed from SUPPLEMENTAL_CONVERSION.akr2008-09-131-11/+11
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (make_writeconv): use rb_enc_name.akr2008-09-131-6/+6
| | | | | | | | | | | | | (make_readconv): ditto. * transcode.c (rb_econv_open_opts): ditto. (econv_args): ditto. (decorate_convpath): ditto. (econv_set_replacement): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19324 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (rb_econv_prepare_opts): raise ArgumentError ifakr2008-09-121-1/+6
| | | | | | | a broken string is specified as a replacement. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (rb_econv_prepare_opts): initialize *opt and return 0akr2008-09-121-2/+4
| | | | | | | if opthash is nil. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enc/trans/escape.trans: transcoder name renamed to use underscore.akr2008-09-121-9/+9
| | | | | | | | * transcode.c: follow the renaming. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (rb_econv_init_by_convpath_i): new function.akr2008-09-121-10/+121
| | | | | | | | (rb_econv_init_by_convpath): new function. (econv_init): use rb_econv_init_by_convpath. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (econv_args): take snamev_p and dnamev_p to preventakr2008-09-121-10/+13
| | | | | | | | possible GC problem. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (enc_arg): take arg as VALUE * to prevent GC problem.akr2008-09-121-7/+10
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (rb_econv_add_transcoder_at): fix loop condition.akr2008-09-121-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (decorator_names): extracted from rb_econv_open.akr2008-09-121-59/+186
| | | | | | | | | | | | | (rb_econv_open): use decorator_names. (econv_args): extracted from econv_init. (econv_init): use econv_args. (decorate_convpath): new function. (search_convpath_i): new function. (econv_s_search_convpath): new method. (Init_transcode): new method defined. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e