summaryrefslogtreecommitdiff
path: root/encoding.c
AgeCommit message (Collapse)Author
2012-12-01adjust style.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-06reapply r37098nobu
UTF-16 and UTF-32 are also treated as unicode since r37101. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-06Revert r37098naruse
This reverts * encoding.c (rb_enc_unicode_p): oniguruma provides Unicode flag. because UTF-16 and UTF-32 is also treated as unicode in this context. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-06encoding.c: unicode_pnobu
* enc/encdb.c, enc/utf_16_32.h (ENC_DUMMY_UNICODE): endian-less wide UTF encodings are dummy but Unicode. * encoding.c (rb_encdb_set_unicode): set Unicode flag. * template/encdb.h.tmpl: allow ENC_DUMMY variants. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-05encoding.c: unicode_pnobu
* encoding.c (rb_enc_unicode_p): oniguruma provides Unicode flag. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-18add castsshyouhei
* encoding.c (load_encoding): explicit cast to suppress warning. Though the cast truncates some bits, from heuristic analysis I believe it is OK to do so here. * bignum.c (rb_cstr_to_inum): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-13encoding.c: strdup macronobu
* encoding.c (enc_alias_internal): use strdup defined as macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-08* remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-15* reduce UNREACHABLE.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-13* encoding.c (rb_enc_codepoint_len): Use UNREACHABLE to avoid "controldrbrain
reaches end of non-void function" warnings. [ruby-trunk - Bug #6066] * re.c (name_to_backref_number): ditto. * object.c (rb_Float): ditto. * io.c (io_readpartial): ditto. * io.c (io_read_nonblock): ditto. * pack.c (rb_uv_to_utf8): ditto. * proc.c (rb_method_entry_arity): ditto. * vm_method.c (rb_f_notimplement): ditto. * struct.c (rb_struct_aset_id): ditto. * class.c (rb_scan_args): ditto. * process.c (rlimit_resource_type): ditto. * process.c (rlimit_resource_value): ditto. * process.c (p_uid_switch): ditto. * process.c (p_gid_switch): ditto. * ext/digest/digest.c (rb_digest_instance_update): ditto. * ext/digest/digest.c (rb_digest_instance_finish): ditto. * ext/digest/digest.c (rb_digest_instance_reset): ditto. * ext/digest/digest.c (rb_digest_instance_block_length): ditto. * ext/bigdecimal/bigdecimal.c (BigDecimalCmp): ditto. * ext/dl/handle.c (rb_dlhandle_close): ditto. * ext/tk/tcltklib.c (pending_exception_check0): ditto. * ext/tk/tcltklib.c (pending_exception_check1): ditto. * ext/tk/tcltklib.c (ip_cancel_eval_core): ditto. * ext/tk/tcltklib.c (lib_get_reltype_name): ditto. * ext/tk/tcltklib.c (create_dummy_encoding_for_tk_core): ditto. * ext/tk/tkutil/tkutil.c (tk_hash_kv): ditto. * ext/openssl/ossl_ssl.c (ossl_ssl_session_reused): ditto. * ext/openssl/ossl_pkey_ec.c (ossl_ec_key_dsa_verify_asn1): ditto. * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_at_infinit): ditto. * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_on_curve): ditto. * ext/fiddle/conversions.c (generic_to_value): ditto. * ext/socket/raddrinfo.c (rsock_io_socket_addrinfo): ditto. * ext/socket/socket.c (sock_s_getnameinfo): ditto. * ext/ripper/eventids2.c (ripper_token2eventid): ditto. * cont.c (return_fiber): ditto. * dmydln.c (dln_load): ditto. * vm_insnhelper.c (vm_search_normal_superclass): ditto. * bignum.c (big_fdiv): ditto. * marshal.c (r_symlink): ditto. * marshal.c (r_symbol): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-12* encoding.c (rb_find_encoding): new function find encoding fromnobu
arbitrary object as a pointer to rb_encoding, and return NULL if not found. * io.c (io_encoding_set): just warn unsupported encodings, but not exception. [ruby-core:40726] [Bug #5567] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-15Correct documentation of r34608.naruse
* correct explanation of ASCII-8BIT. * "Locale encoding" is the name of the encoding derived from Encoding.locale_encoding. Its correct name is "Script encoding". * Add Locale encoding and Filesystem encoding. * default external is set by locale encoding if -E is not given. * functional methods normally written as functional style on ruby's doc. * fix typo. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-15Temporary fix not to use non ASCII.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-14* encoding.c (Init_Encoding): Add IO example of internal and externaldrbrain
encoding. Fixed a typo in the force_encoding example. [#5949] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-14* encoding.c (Init_Encoding): Add Encoding documentation.drbrain
[ruby-trunk - Bug #5949] * encoding.c (rb_set_default_external): Fix typo in documentation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-05* encoding.c (rb_enc_compatible): return ASCII-8BIT even if 2nd stringnaruse
is ascii only string. [ruby-core:42354] [Bug #5968] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-21* encoding.c (rb_enc_compatible): fix segv on symbols.naruse
[ruby-core:42204] [Bug #5921] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-03* encoding.c (rb_locale_charmap): ignore calling nl_langinfo_codeset()usa
on Windows except cygwin. [experimental] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-25* encoding.c (require_enc): reject only loading from untrustednobu
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
2011-09-06* encoding.c (load_encoding): predefined encoding names are safe.nobu
[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
2011-08-02* encoding.c (enc_find): mistakenly remained !. [Bug #5150]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-02Revert "* encoding.c (enc_find): simplified with RB_TYPE_P."naruse
This reverts commit r32817. It has less code on the surface, but it needs more condition. Moreover it doesn't need !. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-02* encoding.c (enc_find): simplified with RB_TYPE_P.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-02Fix r32811: add UNSPECIFIED_ENCODING case.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-02* encoding.c (str_to_encoding): rename from to_encoding andnaruse
use str_to_encindex. * encoding.c (str_to_encindex): split from to_encoding. * encoding.c (rb_to_encoding): use str_to_encoding. * encoding.c (rb_obj_encoding): don't bypass rb_encoding*. If it uses rb_encoding*, it bypass encindex. If it uses encindex, it doesn't bypass. * encoding.c (enc_find): add shortcut for encoding object, use str_to_encindex, and avoid bypass rb_encoding*. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-07* encoding.c (rb_enc_set_index, rb_enc_associate_index): shouldnobu
check if frozen. * parse.y (rb_intern3), ruby.c (process_options, ruby_script): defer freezing after associating encodings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-17* internal.h: declare internal functions here.akr
* 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
2011-06-10* encoding.c (rb_locale_charmap): When ruby process is run as Windowsnaruse
Service the console codepage is not set, GetConsoleCP returns 0. So on such environment, use GetACP(). http://blogs.msdn.com/b/michkap/archive/2005/02/08/369197.aspx patched by Rafal Bigaj [ruby-core:36832] [Bug #4854] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-10 * encoding.c: Mention that Encoding.compatible? can work with moredrbrain
than just Strings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-19* lib: revert r31635-r31638 and untabify with expand(1).nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-18 * encoding.c: Improve documentation for Encoding#default_external anddrbrain
Encoding#default_internal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-26* encoding.c (enc_find): accept Encoding objects.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-15* encoding.c (rb_enc_compatible): change the rule for empty strings:naruse
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
2010-12-11* encoding.c: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-02* encoding.c (enc_alias_internal): use st_insert2 and change returnnaruse
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
2010-12-02* encoding.c (enc_alias_internal): use xfree instead of free.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-02* encoding.c (enc_alias_internal): free the copied key andnaruse
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
2010-07-21* configure.in (XCFLAGS): use -fvisibility=hidden if possible.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-18* include/ruby/ruby.h (rb_data_type_t): restructured. [ruby-dev:41862]nobu
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
2010-07-17update doc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-31update comment.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-31* encoding.c (rb_enc_unicode_p): check the encoding is Unicodenaruse
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
2010-05-29* encoding.c (rb_filesystem_encindex): avoid infinite requirenaruse
loop. [ruby-core:30467] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-27* include/ruby/encoding.h (rb_filesystem_encindex): defined.naruse
* 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
2010-05-17* array.c: Documentation: change => in call-seq to ->.marcandre
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-04-11* encoding.c (enc_replicate): new encoding name must be validnobu
c-string. [ruby-dev:40954] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-11fix rdockazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-06* encoding.c (enc_set_filesystem_encoding):naruse
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
2009-12-21* encoding.c (Init_Encoding): undef Encoding.new becausenaruse
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
2009-12-12Add rdoc and test of Encoding#replicate.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e