summaryrefslogtreecommitdiffstats
path: root/encoding.c
Commit message (Collapse)AuthorAgeFilesLines
* * 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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/ruby/trunk@25666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix typos.akr2009-11-031-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/ruby/trunk@25558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (enc_find): fixed rdoc formatting.nobu2009-10-281-6/+7
| | | | git-svn-id: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/ruby/trunk@25526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix a typo.akr2009-10-231-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/ruby/trunk@24423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_enc_get_index): fixed indent.nobu2009-08-061-25/+25
| | | | git-svn-id: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/ruby/trunk@24383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * suppressed shorten-64-to-32 warnings.nobu2009-07-181-8/+9
| | | | git-svn-id: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/ruby/trunk@23308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* stripped trailing spaces.nobu2009-02-221-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/ruby/trunk@21930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (enc_set_default_encoding): should not treat US-ASCIImatz2009-01-151-6/+3
| | | | | | | special here. a patch from Yui NARUSE in [ruby-dev:37769]. [ruby-dev:37699] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_locale_charmap): fixed typo.nobu2009-01-151-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in, win32/Makefile.sub (MISSING): added langinfo on mingwnobu2009-01-151-3/+1
| | | | | | | | | | | | and mswin. * encoding.c (rb_locale_charmap): use environments on mingw and mswin. * missing/langinfo.c (nl_langinfo_codeset): MS-Windows Japanese environment uses Windows-31J derived from Shift_JIS, not EUC-JP. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_locale_charmap): fallback to codepage if nonobu2009-01-141-0/+9
| | | | | | | | | | locale is found. [ruby-core:21110] * missing/langinfo.c (nl_langinfo_codeset): returns NULL if no locale is found. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* describe Encoding.find("locale") in rdoc of Encoding.locale_charmap.akr2009-01-121-0/+5
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_locale_charmap): use GetConsoleCP() instead ofusa2009-01-051-2/+2
| | | | | | | | | | | GetACP() because external encoding should be console's one. * encoding.c (rb_filesystem_encoding): use GetOEMCP() instead of GetACP() because VFAT/FAT32 uses OEM CP. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_filesystem_encoding): use ANSI codepage for filenobu2009-01-051-10/+11
| | | | | | | | | system on cygwin. * encoding.c (rb_locale_charmap): reverted. [ruby-core:21110] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_filesystem_encoding, rb_locale_charmap): usesnobu2009-01-041-4/+12
| | | | | | | codepage on cygwin. [ruby-core:20994] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (default_external): endless recursion duringyugui2008-12-131-1/+1
| | | | | | | | loading a locale encoding on some locale. fixed by Nobuyuki Nakada. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_enc_set_default_external): default_internal can beyugui2008-12-121-1/+8
| | | | | | | | | | nil, but default_external cannot. * encoding.c (rb_set_default_internal): adds rdoc. * encoding.c (enc_find): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (enc_get_default_encoding): removed.yugui2008-12-121-11/+13
| | | | | | | | | | | | | | | | | | | | Generalizing rb_default_{external,internal}_encoding seems to be difficult. default_external cannot be NULL even before detected. [ruby-dev:37390] * encoding.c (rb_default_external_encoding): has its own implementation again. * encoding.c (rb_default_internal_encoding): ditto. * gem_prelude.rb: added notice. * ruby.c (rubylib_mangled_path, rubylib_mangled_path2): uses locale encoding but not ASCII-8BIT. * ruby.c (process_options): refers less to default_external. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_enc_aliases_enc_i): skips default internal.nobu2008-12-111-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (enc_set_default_encoding): allowed to set defaultnobu2008-12-111-36/+79
| | | | | | | encoding. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_enc_set_default_internal): defines internalnobu2008-12-111-1/+9
| | | | | | | encoding as nil. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_locale_encoding): removed Encoding::LOCALE.nobu2008-12-111-5/+12
| | | | | | | | | * encoding.c (rb_enc_set_default_external): ditto. * encoding.c (rb_enc_set_default_internal): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_enc_set_default_internal): no alias "internal" ifnobu2008-10-311-2/+7
| | | | | | | defalt internal is not set. [ruby-dev:37000] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_locale_encoding): makes an alias for locale.nobu2008-10-301-5/+7
| | | | | | | | | | | [ruby-dev:36976] * encoding.c (rb_enc_set_default_external): ditto for external. * encoding.c (rb_enc_set_default_internal): ditto for internal. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (enc_names): minor improvement.nobu2008-10-091-8/+11
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (Init_Encoding): new instance method Encoding#names,naruse2008-10-091-0/+30
| | | | | | | | | | returns its name and alias names. * encoding.c (enc_names): defined for Encoding#names. * encoding.c (enc_names_i): defined for enc_names. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_default_internal_encoding): merged a patch frommatz2008-10-071-0/+50
| | | | | | | | | | | Michael Selig <michael.selig at fs.com.au> in [ruby-core:18985]. * io.c (rb_io_ext_int_to_encs): ditto. * ruby.c (proc_options): support default internal encoding in -E option. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e