summaryrefslogtreecommitdiff
path: root/encoding.c
AgeCommit message (Collapse)Author
2008-01-18* parse.y (parser_initialize): explicitly call rb_ascii8bit_encoding().matz
* parse.y (parser_prepare): lex_input may not be have encoding (e.g. IO). * parse.y (rb_parser_compile_string): set encoding from input string. * encoding.c (rb_enc_find_index): use ASCII-8BIT if loading known encoding failed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-17* encoding.c (enc_free): removed since rb_encoding may be used whilenobu
cleanup. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-17* common.mk (encdb.h): give output file name to make_encdb.rb.nobu
* encoding.c (enc_table): simplified. * encoding.c (enc_register_at): lazy loading. [ruby-dev:33013] * regenc.h (ENC_DUMMY): added. * enc/make_encdb.rb: now emits macros only. * enc/iso_2022_jp.h: split from encoding.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-16* encoding.c (enc_register_at): make own copy. [ruby-dev:33136]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-15* encoding.c (ENC_REGISTER): use &OnigEncoding*.naruse
(ENCINDEX_UTF_8): renamed from ENCINDEX_UTF8. (rb_enc_init): use ENC_REGISTER. * include/ruby/oniguruma.h (OnigEncodingUTF8, ONIG_ENCODING_UTF8): removed. * enc/*.c: remove use of &encoding_*; use enc argument instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-15* encoding.c (rb_locale_charmap): use ASCII-8BIT in miniruby.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-14* common.mk (OBJS): moved encoding.o from COMMONOBJS.nobu
* common.mk (dmyencoding.o): added. [ruby-dev:33099] * configure.in, {win,bcc}32/Makefile.sub (MINIOBJS): added dmyencoding.o. * dmyencoding.c (rb_locale_charmap): returns nil for miniruby. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-14* re.c (rb_char_to_option_kcode): use rb_enc_find_index() insteadmatz
of using fixed index value. * enc/Makefile.in (encsrcdir): make US-ASCII built-in. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-14* encoding.c (rb_locale_encoding): return US-ASCII when charmap is nil.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-13* enc/make_encdb.h: sort encoding names by original name.naruse
* encoding.c, enc/*.c: define replicas and aliases. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-13* encoding.c: add documents.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-13* encoding.c (Init_Encoding): moved initialization from encdb.h.nobu
* enc/make_encdb.rb (enc_name_list): constified. * enc/make_encdb.rb (enc_init_db): moved some functions to encoding.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-13* encoding.c (ENCINDEX_EUC_JP, ENCINDEX_SJIS): removed.naruse
(rb_enc_init): EUC-JP and Shift_JIS are not builtin now. * enc/Makefile.in: ditto. * common.mk: ditto. * ruby.c (proc_options): ditto. * enc/shift_jis.c, enc/euc_jp.c: fixes for romove from builtin. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-13* encoding.c (enc_table): packed all enc_table stuff.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-13* encoding.c (rb_enc_init): revert removing SJIS.naruse
* enc/sjis.c: move to enc/shift_jis.c, to make encoding name equal to filename for convinience of loading lib. * enc/shift_jis.c: moved from enc/sjis.c. * common.mk: follows enc/shift_jis.c. * enc/Makefile.in: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-12* encoding.c (rb_enc_aliases): don't see enc_table_alias when it wasn't ↵naruse
initialized yet. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-12* enc/make_encdb.rb: added. search enc/*.c and make encoding database.naruse
* regenc.h (ENC_REPLICATE, ENC_ALIAS): added for defining replica encoding and encoding alias. * encoding.c (rb_enc_init): move alias definitions to enc/*.c. (rb_enc_find_index): search original of replica and alias when no encoding library. (rb_enc_name_list, rb_enc_aliases_enc_i, rb_enc_aliases_str_i, rb_enc_aliases, Encoding.name_list, Encoding.aliases): added. (Init_Encoding): init encdb. * enc/ascii.c, enc/us_ascii.c, enc/euc_jp.c, enc/sjis.c: add replica encoding and encoding alias difinition. * common.mk (dist-clean-local): add rule for remvoe encdb.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-11* encoding (set_base_encoding): must use rb_enc_dummy_p.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-10* encoding.c (rb_to_encoding_index, rb_to_encoding): disallow nil.nobu
[ruby-dev:33003] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-09* encoding.c (rb_enc_replicate): replica of dummy is a dummy.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-08* encoding.c (rb_enc_init): UTF-{16,32}{BE,LE} are not builtin.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-08* encoding.c, Makefile.in, include/ruby/oniguruma.h,naruse
enc/Makefile.in: fix rules for UTF-{16,32}{BE,LE}. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-07* include/ruby/oniguruma.h (OnigEncodingType): new memberakr
ruby_encoding_index to avoid linear search in rb_enc_to_index. * include/ruby/encoding.h (rb_enc_to_index): macro defined to use ruby_encoding_index. * encoding.c (rb_enc_to_index): removed. (enc_register_at): initialize ruby_encoding_index member. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-07* encoding.c (rb_enc_internal_get_index): extracted fromakr
rb_enc_get_index. (rb_enc_internal_set_index): extracted from rb_enc_associate_index * include/ruby/encoding.h (ENCODING_SET): work over ENCODING_INLINE_MAX. (ENCODING_GET): ditto. (ENCODING_IS_ASCII8BIT): defined. (ENCODING_CODERANGE_SET): defined. * re.c (rb_reg_fixed_encoding_p): use ENCODING_IS_ASCII8BIT. * string.c (rb_enc_str_buf_cat): use ENCODING_IS_ASCII8BIT. * parse.y (reg_fragment_setenc_gen): use ENCODING_IS_ASCII8BIT. * marshal.c (has_ivars): use ENCODING_IS_ASCII8BIT. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-06* $Date$ keyword removed to avoid inclusion of locale dependentakr
string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-05update rdoc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-05* encoding.c (Init_Encoding): alias csWindows31J to Windows-31J.akr
IE6 accepts csWindows31J but Windows-31J. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-03* encoding.c: (rb_tolower, rb_toupper): body was exchanged.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-03* encoding.c (rb_isalnum): defined.akr
(rb_isalpha): ditto. (rb_isblank): ditto. (rb_iscntrl): ditto. (rb_isdigit): ditto. (rb_isgraph): ditto. (rb_islower): ditto. (rb_isprint): ditto. (rb_ispunct): ditto. (rb_isspace): ditto. (rb_isupper): ditto. (rb_isxdigit): ditto. (rb_tolower): ditto. (rb_toupper): ditto. * include/ruby/ruby.h: don't include include/ruby/encoding.h. (rb_isascii): defined. (rb_isalnum): declared. (rb_isalpha): ditto. (rb_isblank): ditto. (rb_iscntrl): ditto. (rb_isdigit): ditto. (rb_isgraph): ditto. (rb_islower): ditto. (rb_isprint): ditto. (rb_ispunct): ditto. (rb_isspace): ditto. (rb_isupper): ditto. (rb_isxdigit): ditto. (rb_tolower): ditto. (rb_toupper): ditto. (ISASCII): simplified. (ISPRINT): ditto. (ISSPACE): ditto. (ISUPPER): ditto. (ISLOWER): ditto. (ISALNUM): ditto. (ISALPHA): ditto. (ISDIGIT): ditto. (ISXDIGIT): ditto. (TOUPPER): ditto. (TOLOWER): ditto. * include/ruby/encoding.h (rb_isascii): removed. (rb_isalnum): ditto. (rb_isalpha): ditto. (rb_isblank): ditto. (rb_iscntrl): ditto. (rb_isdigit): ditto. (rb_isgraph): ditto. (rb_islower): ditto. (rb_isprint): ditto. (rb_ispunct): ditto. (rb_isspace): ditto. (rb_isupper): ditto. (rb_isxdigit): ditto. (rb_tolower): ditto. (rb_toupper): ditto. * common.mk: dependency updated. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-01* include/ruby/encoding.h (rb_isascii): defined.akr
(rb_isalnum): ditto. (rb_isalpha): ditto. (rb_isblank): ditto. (rb_iscntrl): ditto. (rb_isdigit): ditto. (rb_isgraph): ditto. (rb_islower): ditto. (rb_isprint): ditto. (rb_ispunct): ditto. (rb_isspace): ditto. (rb_isupper): ditto. (rb_isxdigit): ditto. (rb_tolower): ditto. (rb_toupper): ditto. * include/ruby/st.h (st_strcasecmp): declared. (st_strncasecmp): ditto. * st.c (type_strcasehash): use st_strcasecmp instead of strcasecmp. (st_strcasecmp): defined. (st_strncasecmp): ditto. * include/ruby/ruby.h: include include/ruby/encoding.h. (ISASCII): use rb_isascii. (ISPRINT): use rb_isprint. (ISSPACE): use rb_isspace. (ISUPPER): use rb_isupper. (ISLOWER): use rb_islower. (ISALNUM): use rb_isalnum. (ISALPHA): use rb_isalpha. (ISDIGIT): use rb_isdigit. (ISXDIGIT): use rb_isxdigit. (TOUPPER): defined. (TOLOWER): ditto. (STRCASECMP): ditto. (STRNCASECMP): ditto. * dir.c, encoding.c, file.c, hash.c, process.c, ruby.c, time.c, transcode.c, ext/readline/readline.c: use locale insensitive functions. [ruby-core:14662] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-31* encoding.c (rb_to_encoding): raises for non-nil, non-encoding,nobu
non-string object. [ruby-core:14634] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-31fix typos.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-30* encoding.c (Init_Encoding): registered rb_encoding differs fromnobu
ONIG_ENCODINGs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-29 * encoding.c (Init_encoding): register Windows-31J and its alias.usa
[ruby-dev:32843] * ruby.c (proc_options): -Ks options means Windows-31J, not Shift_JIS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-28 * encoding.c (rb_locale_encoding): should check return value fromusa
rb_locale_charmap(). * ruby.c (locale_encoding): removed. * ruby.c (process_options): use rb_locale_encoding() instead of locale_encoding(). * ext/readline/readline.c (readline_readline): use locale encoding instead of input IO's encoding. [ruby-dev:32872] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-28* encoding.c (rb_locale_encoding): defined.akr
* include/ruby/encoding.h (rb_locale_encoding): declared. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-28* encoding.c (set_base_encoding, enc_base_encoding): renamednobu
based_encoding as base_encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-27* encoding.c (rb_enc_codelen): show codepoint in error message.akr
* include/ruby/encoding.h (rb_enc_codelen): comment it returns positive integer. * string.c (rb_str_concat): rb_enc_codelen doesn't return 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-27* encoding.c (rb_enc_codelen): error message refined.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-27* encoding.c (rb_enc_check): show encodings in error message.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-25* encoding.h (rb_enc_mbc_to_codepoint): wrapper fornobu
ONIGENC_MBC_TO_CODE(). * string.c (rb_str_succ): deal with invalid sequence as binary. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-25* string.c (rb_str_inspect): don't call rb_enc_codepoint with emptyakr
string. fix '#'.inspect. * encoding.c (rb_enc_codepoint): raise on empty string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-25* encoding.c (rb_enc_register): do not use based_encoding to check ifnobu
dummy encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-23* encoding.c (rb_enc_codepoint): implemented to raise invalidakr
encoding. * include/ruby/encoding.h (rb_enc_codepoint): macro is replaced as a declaration. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-23add a comment for eucJP.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-23* encoding.c (rb_enc_init): add eucJP as an alias of EUC-JP.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-22* include/ruby/encoding.h, encoding.c, re.c, io.c, parse.y, numeric.c,akr
ruby.c, transcode.c: rename rb_ascii_encoding. to rb_ascii8bit_encoding. rb_ascii_encoding is ambiguous with ASCII-8BIT and US-ASCII. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-22document updated.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-22add rdoc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-22* regenc.c (onigenc_ascii_is_code_ctype): moved from enc/ascii.c.akr
* regenc.h (onigenc_ascii_is_code_ctype): declared. * enc/ascii.c: use onigenc_ascii_is_code_ctype. * enc/us_ascii.c: new file for US-ASCII. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e