aboutsummaryrefslogtreecommitdiffstats
path: root/transcode.c
Commit message (Collapse)AuthorAgeFilesLines
...
* transcode.c: Simplified rb_econv_binmode, avoided a warning on cygwin.duerst2011-11-301-27/+14
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * use RB_TYPE_P which is optimized for constant types, instead ofnobu2011-09-291-4/+4
| | | | | | comparison with TYPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (require_enc): reject only loading from untrustednobu2011-09-251-1/+2
| | | | | | | load paths. [ruby-dev:44541] [Bug #5279] * transcode.c (load_transcoder_entry): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (rb_declare_transcoder, load_transcoder_entry): nonobu2011-09-071-13/+7
| | | | | | longer need to limit the length of transcoder library name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (load_transcoder_entry): concatenate paths directly.nobu2011-09-061-3/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (load_encoding): predefined encoding names are safe.nobu2011-09-061-1/+5
| | | | | | | [ruby-dev:44469] [Bug #5279] * transcode.c (load_transcoder_entry): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c: enabled econv newline option.nobu2011-09-061-0/+50
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (rb_econv_binmode): newline decorators arenobu2011-09-051-11/+13
| | | | | | exclusive. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (validate_enc_binmode, prep_stdio): default to text mode onnobu2011-09-021-1/+1
| | | | | | | | | dosish platforms. [ruby-core:38822] [Bug #5164] * transcode.c (rb_econv_prepare_options): keep default ecflags unchanged if no options. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h: declare internal functions here.akr2011-06-171-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | * node.h: declare NODE dependent internal functions here. * iseq.h: declare rb_iseq_t dependent internal functions here. * vm_core.h: declare rb_thread_t dependent internal functions here. * bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c, enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c, iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y, proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c, thread.c, time.c, transcode.c, variable.c, vm.c, tool/compile_prelude.rb: don't declare internal functions declared in above headers. include above headers if required. Note that rb_thread_mark() was declared as void rb_thread_mark(rb_thread_t *th) in cont.c but defined as void rb_thread_mark(void *ptr) in vm.c. Now it is declared as the later in internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (econv_init): revert r31353. [ruby-dev:43512]nobu2011-05-151-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (econv_opts): add newline option.nobu2011-04-261-0/+37
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (validate_enc_binmode, rb_io_extract_modeenc): set newlinenobu2011-04-261-14/+30
| | | | | | | | decorator according to open mode. * transcode.c (rb_econv_prepare_options): new function, to prepare econv options with newline flags. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h (ECONV_NEWLINE_DECORATOR_MASK): add.nobu2011-04-261-13/+11
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (econv_init): fix rdoc.nobu2011-04-261-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (encoded_dup): extract.nobu2011-02-051-9/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c: parenthesize macro arguments.akr2011-01-091-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Alter comment on String#encode for better wording and ri outputdrbrain2010-12-161-23/+23
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (transcode_loop): call default handler of the givennobu2010-12-071-6/+43
| | | | | | | hash, method, proc or [] method as fallback. [ruby-dev:42692] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c, gc.c, hash.c, object.c, string.c, struct.c,nobu2010-10-241-3/+1
| | | | | | | | transcode.c, variable.c, vm.c, vm_insnhelper.c, vm_method.c: replace calls to rb_error_frozen() with rb_check_frozen(). a patch from Run Paint Run Run at [ruby-core:32014] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Commit miss.nobu2010-10-191-1/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_sprintf.rb: fix ML ref. [ruby-core:32848]nobu2010-10-191-3/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (rb_scan_args): Add support for optional keywordknu2010-09-101-23/+26
| | | | | | | | | | | | | | | | | | | | argument hash. * README.EXT, README.EXT.ja: Update documentation accordingly. * dir.c (dir_initialize): Make use of the new rb_scan_args() feature. * io.c (rb_io_s_popen, rb_scan_open_args, rb_io_initialize) (rb_io_s_pipe, open_key_args, io_s_foreach, io_s_readlines) (rb_io_s_read, rb_io_set_encoding): Ditto. * transcode.c (str_transcode, econv_args) (econv_primitive_convert): Ditto. * ext/zlib/zlib.c (rb_gzreader_initialize): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (rb_data_type_t): restructured. [ruby-dev:41862]nobu2010-07-181-1/+1
| | | | | | | | add parent member. * error.c (rb_typeddata_inherited_p): new function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_str_encode_ospath): when the encoding of the parameterusa2010-06-171-1/+6
| | | | | | | | | | | | | | | | | is ASCII-8BIT, should recognize as filesystem encoding, and convert to UTF-8 on Windows. * file.c (realpath_rec): should convert to ospath encoding before calling lstat(). * file.c (rb_realpath_internal): resolved string should take over the encoding of base string. * transcode.c (rb_str_encode): should return new string always. fixed #3444. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: Documentation: change => in call-seq to ->.marcandre2010-05-171-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Harmonize "#=>" in examples. [ruby-core:30206] * bignum.c: ditto * class.c: ditto * compar.c: ditto * cont.c: ditto * dir.c: ditto * encoding.c: ditto * enum.c: ditto * enumerator.c: ditto * error.c: ditto * eval.c: ditto * file.c: ditto * gc.c: ditto * io.c: ditto * load.c: ditto * marshal.c: ditto * math.c: ditto * numeric.c: ditto * object.c: ditto * pack.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * range.c: ditto * re.c: ditto * ruby.c: ditto * signal.c: ditto * sprintf.c: ditto * string.c: ditto * struct.c: ditto * thread.c: ditto * time.c: ditto * transcode.c: ditto * variable.c: ditto * vm_eval.c: ditto * vm_method.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c: RDoc for subclasses of Exception. [ruby-core:28394]marcandre2010-05-081-0/+22
| | | | | | | | | | | | | | | | | | | | | | * cont.c: ditto * enumerator.c: ditto * io.c: ditto * math.c: ditto * numeric.c: ditto * proc.c: ditto * re.c: ditto * thread.c: ditto * transcode.c: ditto. Thanks to Run Paint for some of the documentation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (transcode_loop): suppressed a warning.nobu2010-04-181-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (transcode_loop): insert output the value whennaruse2010-04-131-1/+38
| | | | | | | | | | fallback hash has a related key. [ruby-dev:40540] [ruby-dev:40829] #3036 * transcode.c (rb_econv_prepare_opts): pass to newhash a value with the key :fallback. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (str_transcode0): confirm the code range.nobu2010-03-111-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (econv_opts): set :undef => :replace whennaruse2010-03-051-0/+5
| | | | | | :replace is given and :invalid is not given. [ruby-dev:40554] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode_data.h, transcode.c, tool/transcode-tblgen.rb: Addedduerst2009-12-101-0/+26
| | | | | | | | | | | | support for new transcoding instruction FUNsio (with Tatsuya Mizuno) * enc/trans/gb18030.trans: Significantly reduced GB18030 conversion table footprint using FUNsio and differences (with Tatsuya Mizuno) * test/ruby/test_transcode.rb: Minor name fix (from Tatsuya Mizuno) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * removed spaces just before tabs.nobu2009-11-261-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c: Added a check for an internal errorduerst2009-11-251-0/+2
| | | | | | | (with Tatsuya Mizuno) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix typos.akr2009-11-031-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (rb_transcoding, str_transcoding_resize): fixednobu2009-10-101-29/+32
| | | | | | | types. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c: reverted r25277.nobu2009-10-101-32/+29
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (rb_transcoding, str_transcoding_resize): fixednobu2009-10-101-29/+32
| | | | | | | types. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (econv_data_type): typed.nobu2009-09-091-13/+22
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (str_encode_bang): C99ism.usa2009-07-311-2/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c: added check for frozen string for encode! (see Bug #1836)duerst2009-07-301-0/+4
| | | | | | | * test/ruby/test_transcode.rb: added tests for the above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (enc_arg): default interanl encoding may not be set.nobu2009-06-211-2/+2
| | | | | | | [ruby-core:23932] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_memsize): added.ko12009-06-161-0/+40
| | | | | | | | | | | | * io.c (rb_io_memsize): added. * regcomp.c (onig_memsize): added. * string.c (rb_str_memsize): added. * transcode.c (rb_transcoding_memsize, rb_econv_memsize): added. * variable.c (rb_geneic_ivar_memsize): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (transcode_restartable0): refix can't build with VC9.naruse2009-06-161-9/+14
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (transcode_restartable0): revert last commit becauseko12009-06-141-10/+9
| | | | | | | | this change cause SEGV at test-all. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (transcode_restartable0): can't build with VC9.naruse2009-06-131-9/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix rdoc.naruse2009-06-131-5/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_enc_codepoint_len): combine rb_enc_codepoint()matz2009-05-191-1/+1
| | | | | | | | | | | | | | | | | | | and rb_enc_codelen() in one function to reduce calls. * encoding.c (rb_enc_codepoint): compatibility function. * sprintf.c (rb_str_format): use rb_enc_codepoint_len(). * string.c (rb_str_inspect, rb_str_upcase_bang, rb_str_downcase_bang, rb_str_capitalize_bang, rb_str_swapcase_bang, trnext, tr_trans, rb_str_delete_bang, rb_str_squeeze_bang, rb_str_count, rb_str_split_m, rb_str_each_line, rb_str_each_codepoint, rb_str_lstrip_bang, sym_printable): ditto. * transcode.c (make_econv_exception): use rb_enc_mbc_to_codepoint() git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix: DON'T move in_p because before in_p is replaced by buffered data.naruse2009-05-051-8/+6
| | | | | | | | | | | | | | | | * transcode.c: NOMAP is now multibyte direct map. * transcode.c: remove ASIS. * transcode_data.h: ditto. * tool/transcode-tb (ActionMap#generate_info): remove :asis. * tool/transcode-tb (ActionMap#generate_info): add :nomap0. * enc/trans/utf8_mac.trans: replace :asis by :nomap0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23344 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (ASIS): added for multi byte direct map.naruse2009-04-261-2/+11
| | | | | | * transcode.c (transcode_restartable0): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e