Граф коммитов

310 Коммитов

Автор SHA1 Сообщение Дата
usa 4df965f4ed * file.c (rb_str_encode_ospath): when the encoding of the parameter
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
2010-06-17 09:46:30 +00:00
marcandre 7729de4d91 * array.c: Documentation: change => in call-seq to ->.
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
2010-05-17 21:07:33 +00:00
marcandre 1dee5e34a3 * error.c: RDoc for subclasses of Exception. [ruby-core:28394]
* 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
2010-05-08 04:50:09 +00:00
nobu 4d82ba512c * transcode.c (transcode_loop): suppressed a warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-18 03:28:12 +00:00
naruse c871aee96b * transcode.c (transcode_loop): insert output the value when
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
2010-04-13 01:26:46 +00:00
nobu c2f7ed2f24 * transcode.c (str_transcode0): confirm the code range.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-11 08:32:03 +00:00
naruse f453c3c0da * transcode.c (econv_opts): set :undef => :replace when
: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
2010-03-05 10:39:56 +00:00
duerst b32ee85f97 * transcode_data.h, transcode.c, tool/transcode-tblgen.rb: Added
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
2009-12-10 11:59:12 +00:00
nobu 4d786d21e3 * removed spaces just before tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-26 05:25:08 +00:00
duerst 80b54214b2 * transcode.c: Added a check for an internal error
(with Tatsuya Mizuno)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-25 10:28:45 +00:00
akr b9e0294eda fix typos.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-03 17:46:28 +00:00
nobu 5d4b63d2fd * transcode.c (rb_transcoding, str_transcoding_resize): fixed
types.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-10 14:51:25 +00:00
nobu 89154445fb * transcode.c: reverted r25277.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-10 12:11:11 +00:00
nobu c4ff156d91 * transcode.c (rb_transcoding, str_transcoding_resize): fixed
types.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-10 03:21:33 +00:00
nobu 913fdf25bc * transcode.c (econv_data_type): typed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-09 03:56:58 +00:00
usa a436212282 * transcode.c (str_encode_bang): C99ism.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-31 04:16:01 +00:00
duerst 5e85648b77 * transcode.c: added check for frozen string for encode! (see Bug #1836)
* 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
2009-07-30 09:40:06 +00:00
nobu 3448160b24 * transcode.c (enc_arg): default interanl encoding may not be set.
[ruby-core:23932]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-21 01:46:37 +00:00
ko1 3caa4ee5e5 * array.c (rb_ary_memsize): added.
* 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
2009-06-16 22:36:27 +00:00
naruse e54f880643 * transcode.c (transcode_restartable0): refix can't build with VC9.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-16 11:10:10 +00:00
ko1 d3027870ee * transcode.c (transcode_restartable0): revert last commit because
this change cause SEGV at test-all.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-14 05:50:46 +00:00
naruse 44a8a15037 * transcode.c (transcode_restartable0): can't build with VC9.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-13 16:54:53 +00:00
naruse 6066cfadab Fix rdoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-13 09:59:46 +00:00
matz 91e5ba1cb8 * encoding.c (rb_enc_codepoint_len): combine rb_enc_codepoint()
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
2009-05-19 16:59:22 +00:00
naruse 3abca796f4 Fix: DON'T move in_p because before in_p is replaced by buffered data.
* 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
2009-05-05 00:05:11 +00:00
naruse 0881a39acd * transcode.c (ASIS): added for multi byte direct map.
* transcode.c (transcode_restartable0): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-26 13:03:50 +00:00
nobu d1abc53721 * array.c, bignum.c, dln.c, error.c, gc.c, io.c, marshal.c,
numeric.c, pack.c, strftime.c, string.c, thread.c, transcode.c,
  transcode_data.h, util.c, variable.c, vm_dump.c,
  include/ruby/encoding.h, missing/crypt.c, missing/vsnprintf.c:
  suppress VC type warnings.  [ruby-core:22726]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-12 09:16:15 +00:00
nobu 12d2c8ba41 stripped trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22 14:23:33 +00:00
akr b916afddc9 * transcode.c (make_econv_exception): refine error message for
undefined conversion.  [ruby-core:21828]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-04 16:45:31 +00:00
akr e193fa79d6 * transcode.c (make_econv_exception): show U+XXXX form for undefined
conversion error from UTF-8.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-04 13:01:12 +00:00
akr 07aeaa0686 * transcode.c (rb_econv_init_by_convpath_i): make it static.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21883 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-29 17:57:13 +00:00
nobu 882cb2e37d * transcode.c (struct rb_transcoding): added ary member for debug.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-27 01:15:37 +00:00
naruse 69ee4246e5 * transcode.c (str_transcode0): fix: :xml option doesn't
work on str.encode([options]) form without default_internal.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-18 18:32:24 +00:00
naruse 81bdf8a1f2 Add rdoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-15 13:47:47 +00:00
duerst 82c673d3a1 * enc/trans/gb18030.trans, gb18030-tbl.rb:
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@21509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-14 11:12:30 +00:00
naruse 7371086f68 Add dummy definition for fake rdoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-13 08:18:16 +00:00
duerst bf6c750c35 * transcode.c: Minor fixes and tweaks in documentation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-30 09:03:04 +00:00
akr 415d59e3e4 * transcode.c (make_econv_exception): show source and destination
encoding.  [ruby-dev:37285]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-27 06:28:34 +00:00
akr b17c5eba46 * io.c (fptr_finalize): close the IO object even if finish_writeconv or
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@21059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-26 05:04:39 +00:00
naruse 20f5c2a3ba * transcode.c (str_transcode0): set encoding when String#encode was
given explicit but the same destination and source encoding.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-25 11:59:57 +00:00
naruse df4699320d * transcode.c (sym_ignore): remove useless symbol.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-25 10:43:35 +00:00
naruse d42b3e5c88 * transcode.c (decorate_convpath): show type of escaping for
xml_attr_quote or some conversions.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-25 08:54:51 +00:00
yugui 5677106ec9 * io.c: rdoc for File::open and 1.9 feature in file modes.
* transcode.c: rdoc for String#encode

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-23 11:30:44 +00:00
duerst da1ffe490d * transcode.c: in transcode_search_path, elimintated a warning
on cygwin about pathlen potentially not being initialized


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-18 07:41:09 +00:00
matz 5ef37965fc * transcode.c (str_transcode0): String#encode without argument now
behave as if :undef => :replace, :invalid => :replace specified.

* transcode.c (rb_econv_prepare_opts): should preserve options in
  any case.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-17 09:13:04 +00:00
akr c2b9d34f62 * transcode.c (transcode_restartable0): in_pos and out_pos never be
NULL, now.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-16 16:26:53 +00:00
matz 80cdf946f7 * transcode.c (str_transcode0): should not raise error when
default_internal is not set.  [ruby-core:19309]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-14 14:05:11 +00:00
nobu a09a8ea86d * transcode.c (rb_econv_init_by_convpath): suppressed warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-13 00:56:40 +00:00
matz 284f4c8431 * transcode.c (str_transcode0): String#encode() with no encoding
specified transcode the string into Encoding.default_internal.
  inspired by [ruby-core:19298].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-12 22:52:01 +00:00
mame fc9c37dfc9 * transcode.c (rb_econv_add_coverter): remove unnecessary NULL check.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-09 15:12:20 +00:00