aboutsummaryrefslogtreecommitdiffstats
path: root/encoding.c
Commit message (Collapse)AuthorAgeFilesLines
* * encoding.c (rb_enc_compatible): change the rule for empty strings:naruse2011-02-151-4/+4
| | | | | | | | remove the special treatment of the US-ASCII encoded empty string. Now Encoding.compatible? usually respect the encoding of the receiver. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c: parenthesize macro arguments.akr2010-12-111-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (enc_alias_internal): use st_insert2 and change returnnaruse2010-12-021-9/+5
| | | | | | | | value to int. * encoding.c (enc_alias): follow enc_alias_internal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (enc_alias_internal): use xfree instead of free.naruse2010-12-021-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (enc_alias_internal): free the copied key andnaruse2010-12-021-4/+11
| | | | | | | | | return NULL when given key is already regisitered. * encoding.c (enc_alias): call set_encoding_const only when the alias is not registered yet. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in (XCFLAGS): use -fvisibility=hidden if possible.nobu2010-07-211-0/+11
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (rb_data_type_t): restructured. [ruby-dev:41862]nobu2010-07-181-1/+2
| | | | | | | | 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
* update doc.akr2010-07-171-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update comment.akr2010-05-311-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_enc_unicode_p): check the encoding is Unicodenaruse2010-05-311-1/+2
| | | | | | or not by the name; not function's pointer. [ruby-dev:41479] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_filesystem_encindex): avoid infinite requirenaruse2010-05-291-1/+1
| | | | | | loop. [ruby-core:30467] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h (rb_filesystem_encindex): defined.naruse2010-05-271-2/+2
| | | | | | | | | | * include/ruby/encoding.h (rb_locale_encindex): ditto. * encoding.c (rb_filesystem_encindex): remove static. * encoding.c (rb_locale_encindex): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: Documentation: change => in call-seq to ->.marcandre2010-05-171-37/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* * encoding.c (enc_replicate): new encoding name must be validnobu2010-04-111-1/+1
| | | | | | | c-string. [ruby-dev:40954] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix rdockazu2010-04-111-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (enc_set_filesystem_encoding):naruse2010-03-061-2/+0
| | | | | | | | | | filesystem encoding on Mac OS X is now default external encoding. so Mac OS X is now treated as one of Unix. [ruby-dev:40439] * file.c (file_path_convert): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (Init_Encoding): undef Encoding.new becausenaruse2009-12-211-0/+1
| | | | | | | | | a class which is rb_undef_alloc-func-ed can't call new method. [ruby-dev:39862] * vm.c (Init_VM): undef RubyVM.new and RubyVM::Env.new. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add rdoc and test of Encoding#replicate.naruse2009-12-121-0/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (enc_replicate): add Encoding#replicate(name).naruse2009-12-101-13/+26
| | | | | | | | | | * encoding.c (enc_replicate_with_index): renamed from old enc_replicate. * encoding.c (rb_enc_from_encoding_index): split from rb_enc_from_encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26059 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
* * encoding.c (enc_set_default_encoding): reset filesytemnaruse2009-11-181-4/+15
| | | | | | | | | | | | | encoding because on resetting default_external because Unix's filesystem encoding depends on default_external. * encoding.c (enc_set_filesystem_encoding): added. * ruby.c (process_options): don't call rb_filesystem_encoding because filesystem encoding is reset when default_external is reset. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_filesystem_encindex): use default external encodingakr2009-11-151-1/+1
| | | | | | | | | | instead of locale encoding in Unix. * ruby.c (process_options): delay inifilesystem encoding initialization after default external encoding initialization. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_filesystem_encindex): add fallback tonaruse2009-11-061-0/+1
| | | | | | ASCII-8BIT on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25666 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
* Revert set locale and filesystem encindex in Init_Encoding.naruse2009-10-291-19/+21
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (Init_Encoding): set locale and filesystem encindex.naruse2009-10-291-21/+19
| | | | | | | * ruby.c (process_options): move setting func of filesystem encoding to Init_Encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (enc_find): fixed rdoc formatting.nobu2009-10-281-6/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (get_filesystem_encoding): removed.naruse2009-10-281-24/+30
| | | | | | | | | | | | | | | | | * encoding.c (rb_locale_encindex): added. * encoding.c (rb_filesystem_encindex): added. * encoding.c (rb_filesystem_encindex): add an alias 'filesystem'. [ruby-dev:39574] * encoding.c (enc_find): add rdoc about special aliases. * gem_prelude.rb (Gem.set_home): use Encoding.find('filesystem'). * gem_prelude.rb (Gem.set_paths): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (get_filesystem_encoding):naruse2009-10-281-0/+17
| | | | | | | add Encoding.filesystem_encoding [ruby-dev:39546] also see [ruby-core:25959] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix a typo.akr2009-10-231-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_enc_unicode_p): defined.naruse2009-09-291-0/+9
| | | | | | | Returns 1 when the encoding is Unicode series other than UTF-7 else 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_filesystem_encoding): On Unix systems,naruse2009-09-281-1/+1
| | | | | | | filesystem encoding should be locale encoding. [ruby-dev:39393] and see also [ruby-dev:35617] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (rb_data_type_struct): constified dsize.nobu2009-09-091-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_enc_compatible): If a string is empty andnaruse2009-08-111-2/+2
| | | | | | | other's encoding is US-ASCII, returns the empty string's encoding. [ruby-list:46274] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (is_data_encoding): fix condition.naruse2009-08-111-2/+2
| | | | | | * encoding.c (enc_capable): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* New API Encoding#ascii_compatible?.naruse2009-08-081-0/+17
| | | | | | | * encoding.c (enc_ascii_compatible_p): added. [ruby-core:24793] (Init_Encoding): New API Encoding#ascii_compatible?. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_enc_associate_index): cannot set encoding onnobu2009-08-061-0/+3
| | | | | | | special constants. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (valid_encoding_name_p): rejects too long encodingnobu2009-08-061-2/+12
| | | | | | | names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (encoding_data_type): typed data.nobu2009-08-061-8/+18
| | | | | | | | * encoding.c (enc_capable, rb_enc_get_index): Symbol is encoding capable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_enc_get_index): fixed indent.nobu2009-08-061-25/+25
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add functions and macros for second encoding definitions.naruse2009-08-041-0/+12
| | | | | | | | | | | | | * encoding.c (rb_enc_set_base): Add for setting base encoding with their names. this is internal function. * template/encdb.h.tmpl: specify ENC_SET_BASE for second encodings in each encoding files. * enc/encdb.c (rb_enc_set_base): add a declaration. (ENC_SET_BASE): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * suppressed shorten-64-to-32 warnings.nobu2009-07-181-8/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (process_options): don't specify .so for encdb here.akr2009-06-221-2/+2
| | | | | | | | | | "." is replaced by "_" in load_encoding. * encoding.c (load_encoding): add .so here. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_enc_name_list): update RDoc. [ruby-core:23926]matz2009-06-191-2/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * rb_enc_get_index: allows an arbitrary RData as the argument but notyugui2009-05-201-0/+4
| | | | | | only what points a rb_encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_enc_fast_mbclen): faster mbclen for strings knownmatz2009-05-201-0/+6
| | | | | | | | | | | | | | | to be valid. * string.c (enc_strlen): coderange specified version of rb_enc_strlen(). use rb_enc_fast_mbclen() if coderange is 7bit or valid. * string.c (str_gsub): use rb_enc_fast_mbclen(). * string.c (rb_str_reverse, rb_str_split_m, rb_str_each_char, scan_once): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_enc_codepoint_len): combine rb_enc_codepoint()matz2009-05-191-2/+11
| | | | | | | | | | | | | | | | | | | 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
* * encoding.c (rb_filesystem_encoding): Change filesystem_encoding ofnaruse2009-04-301-1/+1
| | | | | | Mac OS X to UTF-8. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* stripped trailing spaces.nobu2009-02-221-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_filesystem_encoding): Windows' filesystem encoding isusa2009-02-011-1/+1
| | | | | | | | | sometimes ANSI code page and sometimes OEM code page. we should check whether code page is used. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e