Ruby: include/ruby/encoding.h File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

Macros | Typedefs | Enumerations | Functions | Variables
encoding.h File Reference
`#include "ruby/internal/config.h"`
`#include <stdarg.h>`
`#include "ruby/ruby.h"`
`#include "ruby/oniguruma.h"`
`#include "ruby/internal/dllexport.h"`

Go to the source code of this file.

## Macros
#define | ENCODING_INLINE_MAX RUBY_ENCODING_INLINE_MAX
#define | ENCODING_SHIFT RUBY_ENCODING_SHIFT
#define | ENCODING_MASK RUBY_ENCODING_MASK
#define | RB_ENCODING_SET_INLINED(obj, i)
#define | RB_ENCODING_SET(obj, i) rb_enc_set_index((obj), (i))
#define | RB_ENCODING_GET_INLINED(obj) (int)((RBASIC(obj)->flags & RUBY_ENCODING_MASK)>>RUBY_ENCODING_SHIFT)
#define | RB_ENCODING_GET(obj)
#define | RB_ENCODING_IS_ASCII8BIT(obj) (RB_ENCODING_GET_INLINED(obj) == 0)
#define | ENCODING_SET_INLINED(obj, i) RB_ENCODING_SET_INLINED(obj,i)
#define | ENCODING_SET(obj, i) RB_ENCODING_SET(obj,i)
#define | ENCODING_GET_INLINED(obj) RB_ENCODING_GET_INLINED(obj)
#define | ENCODING_GET(obj) RB_ENCODING_GET(obj)
#define | ENCODING_IS_ASCII8BIT(obj) RB_ENCODING_IS_ASCII8BIT(obj)
#define | ENCODING_MAXNAMELEN RUBY_ENCODING_MAXNAMELEN
#define | RB_ENC_CODERANGE_CLEAN_P(cr) rb_enc_coderange_clean_p(cr)
#define | RB_ENC_CODERANGE(obj) ((int)RBASIC(obj)->flags & RUBY_ENC_CODERANGE_MASK)
#define | RB_ENC_CODERANGE_ASCIIONLY(obj) (RB_ENC_CODERANGE(obj) == RUBY_ENC_CODERANGE_7BIT)
#define | RB_ENC_CODERANGE_SET(obj, cr)
#define | RB_ENC_CODERANGE_CLEAR(obj) RB_ENC_CODERANGE_SET((obj),0)
#define | RB_ENC_CODERANGE_AND(a, b)
#define | RB_ENCODING_CODERANGE_SET(obj, encindex, cr)
#define | ENC_CODERANGE_MASK RUBY_ENC_CODERANGE_MASK
#define | ENC_CODERANGE_UNKNOWN RUBY_ENC_CODERANGE_UNKNOWN
#define | ENC_CODERANGE_7BIT RUBY_ENC_CODERANGE_7BIT
#define | ENC_CODERANGE_VALID RUBY_ENC_CODERANGE_VALID
#define | ENC_CODERANGE_BROKEN RUBY_ENC_CODERANGE_BROKEN
#define | ENC_CODERANGE_CLEAN_P(cr) RB_ENC_CODERANGE_CLEAN_P(cr)
#define | ENC_CODERANGE(obj) RB_ENC_CODERANGE(obj)
#define | ENC_CODERANGE_ASCIIONLY(obj) RB_ENC_CODERANGE_ASCIIONLY(obj)
#define | ENC_CODERANGE_SET(obj, cr) RB_ENC_CODERANGE_SET(obj,cr)
#define | ENC_CODERANGE_CLEAR(obj) RB_ENC_CODERANGE_CLEAR(obj)
#define | ENC_CODERANGE_AND(a, b) RB_ENC_CODERANGE_AND(a, b)
#define | ENCODING_CODERANGE_SET(obj, encindex, cr) RB_ENCODING_CODERANGE_SET(obj, encindex, cr)
#define | rb_enc_name(enc) (enc)->name
#define | rb_enc_mbminlen(enc) (enc)->min_enc_len
#define | rb_enc_mbmaxlen(enc) (enc)->max_enc_len
#define | MBCLEN_CHARFOUND_P(ret) ONIGENC_MBCLEN_CHARFOUND_P(ret)
#define | MBCLEN_CHARFOUND_LEN(ret) ONIGENC_MBCLEN_CHARFOUND_LEN(ret)
#define | MBCLEN_INVALID_P(ret) ONIGENC_MBCLEN_INVALID_P(ret)
#define | MBCLEN_NEEDMORE_P(ret) ONIGENC_MBCLEN_NEEDMORE_P(ret)
#define | MBCLEN_NEEDMORE_LEN(ret) ONIGENC_MBCLEN_NEEDMORE_LEN(ret)
#define | rb_enc_codepoint(p, e, enc) rb_enc_codepoint_len((p),(e),0,(enc))
#define | rb_enc_mbc_to_codepoint(p, e, enc) ONIGENC_MBC_TO_CODE((enc),(UChar*)(p),(UChar*)(e))
#define | rb_enc_code_to_mbclen(c, enc) ONIGENC_CODE_TO_MBCLEN((enc), (c));
#define | rb_enc_mbcput(c, buf, enc) ONIGENC_CODE_TO_MBC((enc),(c),(UChar*)(buf))
#define | rb_enc_prev_char(s, p, e, enc) ((char *)onigenc_get_prev_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))
#define | rb_enc_left_char_head(s, p, e, enc) ((char *)onigenc_get_left_adjust_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))
#define | rb_enc_right_char_head(s, p, e, enc) ((char *)onigenc_get_right_adjust_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))
#define | rb_enc_step_back(s, p, e, n, enc) ((char *)onigenc_step_back((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e),(int)(n)))
#define | rb_enc_is_newline(p, end, enc) ONIGENC_IS_MBC_NEWLINE((enc),(UChar*)(p),(UChar*)(end))
#define | rb_enc_isctype(c, t, enc) ONIGENC_IS_CODE_CTYPE((enc),(c),(t))
#define | rb_enc_isascii(c, enc) ONIGENC_IS_CODE_ASCII(c)
#define | rb_enc_isalpha(c, enc) ONIGENC_IS_CODE_ALPHA((enc),(c))
#define | rb_enc_islower(c, enc) ONIGENC_IS_CODE_LOWER((enc),(c))
#define | rb_enc_isupper(c, enc) ONIGENC_IS_CODE_UPPER((enc),(c))
#define | rb_enc_ispunct(c, enc) ONIGENC_IS_CODE_PUNCT((enc),(c))
#define | rb_enc_isalnum(c, enc) ONIGENC_IS_CODE_ALNUM((enc),(c))
#define | rb_enc_isprint(c, enc) ONIGENC_IS_CODE_PRINT((enc),(c))
#define | rb_enc_isspace(c, enc) ONIGENC_IS_CODE_SPACE((enc),(c))
#define | rb_enc_isdigit(c, enc) ONIGENC_IS_CODE_DIGIT((enc),(c))
#define | rb_enc_asciicompat(enc) rb_enc_asciicompat_inline(enc)
#define | rb_enc_str_asciicompat_p(str) rb_enc_asciicompat(rb_enc_get(str))
#define | ECONV_ERROR_HANDLER_MASK RUBY_ECONV_ERROR_HANDLER_MASK
#define | ECONV_INVALID_MASK RUBY_ECONV_INVALID_MASK
#define | ECONV_INVALID_REPLACE RUBY_ECONV_INVALID_REPLACE
#define | ECONV_UNDEF_MASK RUBY_ECONV_UNDEF_MASK
#define | ECONV_UNDEF_REPLACE RUBY_ECONV_UNDEF_REPLACE
#define | ECONV_UNDEF_HEX_CHARREF RUBY_ECONV_UNDEF_HEX_CHARREF
#define | ECONV_DECORATOR_MASK RUBY_ECONV_DECORATOR_MASK
#define | ECONV_NEWLINE_DECORATOR_MASK RUBY_ECONV_NEWLINE_DECORATOR_MASK
#define | ECONV_NEWLINE_DECORATOR_READ_MASK RUBY_ECONV_NEWLINE_DECORATOR_READ_MASK
#define | ECONV_NEWLINE_DECORATOR_WRITE_MASK RUBY_ECONV_NEWLINE_DECORATOR_WRITE_MASK
#define | ECONV_UNIVERSAL_NEWLINE_DECORATOR RUBY_ECONV_UNIVERSAL_NEWLINE_DECORATOR
#define | ECONV_CRLF_NEWLINE_DECORATOR RUBY_ECONV_CRLF_NEWLINE_DECORATOR
#define | ECONV_CR_NEWLINE_DECORATOR RUBY_ECONV_CR_NEWLINE_DECORATOR
#define | ECONV_XML_TEXT_DECORATOR RUBY_ECONV_XML_TEXT_DECORATOR
#define | ECONV_XML_ATTR_CONTENT_DECORATOR RUBY_ECONV_XML_ATTR_CONTENT_DECORATOR
#define | ECONV_STATEFUL_DECORATOR_MASK RUBY_ECONV_STATEFUL_DECORATOR_MASK
#define | ECONV_XML_ATTR_QUOTE_DECORATOR RUBY_ECONV_XML_ATTR_QUOTE_DECORATOR
#define | ECONV_DEFAULT_NEWLINE_DECORATOR RUBY_ECONV_DEFAULT_NEWLINE_DECORATOR
#define | ECONV_PARTIAL_INPUT RUBY_ECONV_PARTIAL_INPUT
#define | ECONV_AFTER_OUTPUT RUBY_ECONV_AFTER_OUTPUT

## Typedefs
typedef const OnigEncodingType | rb_encoding
typedef struct rb_econv_t | rb_econv_t

## Enumerations
enum | ruby_encoding_consts { RUBY_ENCODING_INLINE_MAX = 127 , RUBY_ENCODING_SHIFT = (RUBY_FL_USHIFT+10) , RUBY_ENCODING_MASK , RUBY_ENCODING_MAXNAMELEN = 42 }
enum | ruby_coderange_type { RUBY_ENC_CODERANGE_UNKNOWN = 0 , RUBY_ENC_CODERANGE_7BIT = ((int)RUBY_FL_USER8) , RUBY_ENC_CODERANGE_VALID = ((int)RUBY_FL_USER9) , RUBY_ENC_CODERANGE_BROKEN = ((int)(RUBY_FL_USER8|RUBY_FL_USER9)) , RUBY_ENC_CODERANGE_MASK }
enum | rb_econv_result_t { econv_invalid_byte_sequence , econv_undefined_conversion , econv_destination_buffer_full , econv_source_buffer_empty , econv_finished , econv_after_output , econv_incomplete_input }
enum | ruby_econv_flag_type { RUBY_ECONV_ERROR_HANDLER_MASK = 0x000000ff , RUBY_ECONV_INVALID_MASK = 0x0000000f , RUBY_ECONV_INVALID_REPLACE = 0x00000002 , RUBY_ECONV_UNDEF_MASK = 0x000000f0 , RUBY_ECONV_UNDEF_REPLACE = 0x00000020 , RUBY_ECONV_UNDEF_HEX_CHARREF = 0x00000030 , RUBY_ECONV_DECORATOR_MASK = 0x0000ff00 , RUBY_ECONV_NEWLINE_DECORATOR_MASK = 0x00003f00 , RUBY_ECONV_NEWLINE_DECORATOR_READ_MASK = 0x00000f00 , RUBY_ECONV_NEWLINE_DECORATOR_WRITE_MASK = 0x00003000 , RUBY_ECONV_UNIVERSAL_NEWLINE_DECORATOR = 0x00000100 , RUBY_ECONV_CRLF_NEWLINE_DECORATOR = 0x00001000 , RUBY_ECONV_CR_NEWLINE_DECORATOR = 0x00002000 , RUBY_ECONV_XML_TEXT_DECORATOR = 0x00004000 , RUBY_ECONV_XML_ATTR_CONTENT_DECORATOR = 0x00008000 , RUBY_ECONV_STATEFUL_DECORATOR_MASK = 0x00f00000 , RUBY_ECONV_XML_ATTR_QUOTE_DECORATOR = 0x00100000 , RUBY_ECONV_DEFAULT_NEWLINE_DECORATOR , RUBY_ECONV_PARTIAL_INPUT = 0x00010000 , RUBY_ECONV_AFTER_OUTPUT = 0x00020000 , RUBY_ECONV_FLAGS_PLACEHOLDER }

## Functions
int | rb_char_to_option_kcode (int c, int *option, int *kcode)
int | rb_enc_replicate (const char *, rb_encoding *)
int | rb_define_dummy_encoding (const char *)
int | rb_enc_dummy_p (rb_encoding *enc)
int | rb_enc_to_index (rb_encoding *enc)
int | rb_enc_get_index (VALUE obj)
void | rb_enc_set_index (VALUE obj, int encindex)
int | rb_enc_capable (VALUE obj)
int | rb_enc_find_index (const char *name)
int | rb_enc_alias (const char *alias, const char *orig)
int | rb_to_encoding_index (VALUE)
rb_encoding * | rb_to_encoding (VALUE)
rb_encoding * | rb_find_encoding (VALUE)
rb_encoding * | rb_enc_get (VALUE)
rb_encoding * | rb_enc_compatible (VALUE, VALUE)
rb_encoding * | rb_enc_check (VALUE, VALUE)
VALUE | rb_enc_associate_index (VALUE, int)
VALUE | rb_enc_associate (VALUE, rb_encoding *)
void | rb_enc_copy (VALUE dst, VALUE src)
VALUE | rb_enc_str_new (const char *, long, rb_encoding *)
VALUE | rb_enc_str_new_cstr (const char *, rb_encoding *)
VALUE | rb_enc_str_new_static (const char *, long, rb_encoding *)
VALUE | rb_enc_interned_str (const char *, long, rb_encoding *)
VALUE | rb_enc_interned_str_cstr (const char *, rb_encoding *)
VALUE | rb_enc_reg_new (const char *, long, rb_encoding *, int)
VALUE | rb_enc_sprintf (rb_encoding *, const char *,...)
VALUE | rb_enc_vsprintf (rb_encoding *, const char *, va_list)
long | rb_enc_strlen (const char *, const char *, rb_encoding *)
char * | rb_enc_nth (const char *, const char *, long, rb_encoding *)
VALUE | rb_obj_encoding (VALUE)
VALUE | rb_enc_str_buf_cat (VALUE str, const char *ptr, long len, rb_encoding *enc)
VALUE | rb_enc_uint_chr (unsigned int code, rb_encoding *enc)
VALUE | rb_external_str_new_with_enc (const char *ptr, long len, rb_encoding *)
VALUE | rb_str_export_to_enc (VALUE, rb_encoding *)
VALUE | rb_str_conv_enc (VALUE str, rb_encoding *from, rb_encoding *to)
VALUE | rb_str_conv_enc_opts (VALUE str, rb_encoding *from, rb_encoding *to, int ecflags, VALUE ecopts)
void | rb_enc_raise (rb_encoding *, VALUE, const char *,...)
rb_encoding * | rb_enc_from_index (int idx)
rb_encoding * | rb_enc_find (const char *name)
int | rb_enc_mbclen (const char *p, const char *e, rb_encoding *enc)
int | rb_enc_fast_mbclen (const char *p, const char *e, rb_encoding *enc)
int | rb_enc_precise_mbclen (const char *p, const char *e, rb_encoding *enc)
int | rb_enc_ascget (const char *p, const char *e, int *len, rb_encoding *enc)
unsigned int | rb_enc_codepoint_len (const char *p, const char *e, int *len, rb_encoding *enc)
unsigned int | rb_enc_codepoint (const char *p, const char *e, rb_encoding *enc)
int | rb_enc_codelen (int code, rb_encoding *enc)
int | rb_enc_code_to_mbclen (int code, rb_encoding *enc)
int | rb_enc_casefold (char *to, const char *p, const char *e, rb_encoding *enc)
int | rb_enc_toupper (int c, rb_encoding *enc)
int | rb_enc_tolower (int c, rb_encoding *enc)
ID | rb_intern3 (const char *, long, rb_encoding *)
ID | rb_interned_id_p (const char *, long, rb_encoding *)
int | rb_enc_symname_p (const char *, rb_encoding *)
int | rb_enc_symname2_p (const char *, long, rb_encoding *)
int | rb_enc_str_coderange (VALUE)
long | rb_str_coderange_scan_restartable (const char *, const char *, rb_encoding *, int *)
int | rb_enc_str_asciionly_p (VALUE)
VALUE | rb_enc_from_encoding (rb_encoding *enc)
int | rb_enc_unicode_p (rb_encoding *enc)
rb_encoding * | rb_ascii8bit_encoding (void)
rb_encoding * | rb_utf8_encoding (void)
rb_encoding * | rb_usascii_encoding (void)
rb_encoding * | rb_locale_encoding (void)
rb_encoding * | rb_filesystem_encoding (void)
rb_encoding * | rb_default_external_encoding (void)
rb_encoding * | rb_default_internal_encoding (void)
int | rb_ascii8bit_encindex (void)
int | rb_utf8_encindex (void)
int | rb_usascii_encindex (void)
int | rb_locale_encindex (void)
int | rb_filesystem_encindex (void)
VALUE | rb_enc_default_external (void)
VALUE | rb_enc_default_internal (void)
void | rb_enc_set_default_external (VALUE encoding)
void | rb_enc_set_default_internal (VALUE encoding)
VALUE | rb_locale_charmap (VALUE klass)
long | rb_memsearch (const void *, long, const void *, long, rb_encoding *)
char * | rb_enc_path_next (const char *, const char *, rb_encoding *)
char * | rb_enc_path_skip_prefix (const char *, const char *, rb_encoding *)
char * | rb_enc_path_last_separator (const char *, const char *, rb_encoding *)
char * | rb_enc_path_end (const char *, const char *, rb_encoding *)
const char * | ruby_enc_find_basename (const char *name, long *baselen, long *alllen, rb_encoding *enc)
const char * | ruby_enc_find_extname (const char *name, long *len, rb_encoding *enc)
ID | rb_check_id_cstr (const char *ptr, long len, rb_encoding *enc)
VALUE | rb_check_symbol_cstr (const char *ptr, long len, rb_encoding *enc)
VALUE | rb_str_encode (VALUE str, VALUE to, int ecflags, VALUE ecopts)
int | rb_econv_has_convpath_p (const char *from_encoding, const char *to_encoding)
int | rb_econv_prepare_options (VALUE opthash, VALUE *ecopts, int ecflags)
int | rb_econv_prepare_opts (VALUE opthash, VALUE *ecopts)
rb_econv_t * | rb_econv_open (const char *source_encoding, const char *destination_encoding, int ecflags)
rb_econv_t * | rb_econv_open_opts (const char *source_encoding, const char *destination_encoding, int ecflags, VALUE ecopts)
rb_econv_result_t | rb_econv_convert (rb_econv_t *ec, const unsigned char **source_buffer_ptr, const unsigned char *source_buffer_end, unsigned char **destination_buffer_ptr, unsigned char *destination_buffer_end, int flags)
void | rb_econv_close (rb_econv_t *ec)
int | rb_econv_set_replacement (rb_econv_t *ec, const unsigned char *str, size_t len, const char *encname)
int | rb_econv_decorate_at_first (rb_econv_t *ec, const char *decorator_name)
int | rb_econv_decorate_at_last (rb_econv_t *ec, const char *decorator_name)
VALUE | rb_econv_open_exc (const char *senc, const char *denc, int ecflags)
int | rb_econv_insert_output (rb_econv_t *ec, const unsigned char *str, size_t len, const char *str_encoding)
const char * | rb_econv_encoding_to_insert_output (rb_econv_t *ec)
void | rb_econv_check_error (rb_econv_t *ec)
VALUE | rb_econv_make_exception (rb_econv_t *ec)
int | rb_econv_putbackable (rb_econv_t *ec)
void | rb_econv_putback (rb_econv_t *ec, unsigned char *p, int n)
const char * | rb_econv_asciicompat_encoding (const char *encname)
VALUE | rb_econv_str_convert (rb_econv_t *ec, VALUE src, int flags)
VALUE | rb_econv_substr_convert (rb_econv_t *ec, VALUE src, long byteoff, long bytesize, int flags)
VALUE | rb_econv_str_append (rb_econv_t *ec, VALUE src, VALUE dst, int flags)
VALUE | rb_econv_substr_append (rb_econv_t *ec, VALUE src, long byteoff, long bytesize, VALUE dst, int flags)
VALUE | rb_econv_append (rb_econv_t *ec, const char *bytesrc, long bytesize, VALUE dst, int flags)
void | rb_econv_binmode (rb_econv_t *ec)

## Variables
VALUE | rb_cEncoding

## Detailed Description

Author

Author
  matz

Date
  Thu May 24 11:49:41 JST 2007

Copyright
  Copyright (C) 2007 Yukihiro Matsumoto
  This file is a part of the programming language Ruby. Permission is hereby granted, to either redistribute and/or modify this file, provided that the conditions mentioned in the file COPYING are met. Consult the file for details.

Definition in file encoding.h.

## Macro Definition Documentation

## ◆ ECONV_AFTER_OUTPUT

#define ECONV_AFTER_OUTPUT RUBY_ECONV_AFTER_OUTPUT

Definition at line 407 of file encoding.h.

## ◆ ECONV_CR_NEWLINE_DECORATOR

#define ECONV_CR_NEWLINE_DECORATOR RUBY_ECONV_CR_NEWLINE_DECORATOR

Definition at line 395 of file encoding.h.

## ◆ ECONV_CRLF_NEWLINE_DECORATOR

#define ECONV_CRLF_NEWLINE_DECORATOR RUBY_ECONV_CRLF_NEWLINE_DECORATOR

Definition at line 394 of file encoding.h.

## ◆ ECONV_DECORATOR_MASK

#define ECONV_DECORATOR_MASK RUBY_ECONV_DECORATOR_MASK

Definition at line 389 of file encoding.h.

## ◆ ECONV_DEFAULT_NEWLINE_DECORATOR

#define ECONV_DEFAULT_NEWLINE_DECORATOR RUBY_ECONV_DEFAULT_NEWLINE_DECORATOR

Definition at line 400 of file encoding.h.

## ◆ ECONV_ERROR_HANDLER_MASK

#define ECONV_ERROR_HANDLER_MASK RUBY_ECONV_ERROR_HANDLER_MASK

Definition at line 383 of file encoding.h.

## ◆ ECONV_INVALID_MASK

#define ECONV_INVALID_MASK RUBY_ECONV_INVALID_MASK

Definition at line 384 of file encoding.h.

## ◆ ECONV_INVALID_REPLACE

#define ECONV_INVALID_REPLACE RUBY_ECONV_INVALID_REPLACE

Definition at line 385 of file encoding.h.

## ◆ ECONV_NEWLINE_DECORATOR_MASK

#define ECONV_NEWLINE_DECORATOR_MASK RUBY_ECONV_NEWLINE_DECORATOR_MASK

Definition at line 390 of file encoding.h.

## ◆ ECONV_NEWLINE_DECORATOR_READ_MASK

#define ECONV_NEWLINE_DECORATOR_READ_MASK RUBY_ECONV_NEWLINE_DECORATOR_READ_MASK

Definition at line 391 of file encoding.h.

## ◆ ECONV_NEWLINE_DECORATOR_WRITE_MASK

#define ECONV_NEWLINE_DECORATOR_WRITE_MASK RUBY_ECONV_NEWLINE_DECORATOR_WRITE_MASK

Definition at line 392 of file encoding.h.

## ◆ ECONV_PARTIAL_INPUT

#define ECONV_PARTIAL_INPUT RUBY_ECONV_PARTIAL_INPUT

Definition at line 406 of file encoding.h.

## ◆ ECONV_STATEFUL_DECORATOR_MASK

#define ECONV_STATEFUL_DECORATOR_MASK RUBY_ECONV_STATEFUL_DECORATOR_MASK

Definition at line 398 of file encoding.h.

## ◆ ECONV_UNDEF_HEX_CHARREF

#define ECONV_UNDEF_HEX_CHARREF RUBY_ECONV_UNDEF_HEX_CHARREF

Definition at line 388 of file encoding.h.

## ◆ ECONV_UNDEF_MASK

#define ECONV_UNDEF_MASK RUBY_ECONV_UNDEF_MASK

Definition at line 386 of file encoding.h.

## ◆ ECONV_UNDEF_REPLACE

#define ECONV_UNDEF_REPLACE RUBY_ECONV_UNDEF_REPLACE

Definition at line 387 of file encoding.h.

## ◆ ECONV_UNIVERSAL_NEWLINE_DECORATOR

#define ECONV_UNIVERSAL_NEWLINE_DECORATOR RUBY_ECONV_UNIVERSAL_NEWLINE_DECORATOR

Definition at line 393 of file encoding.h.

## ◆ ECONV_XML_ATTR_CONTENT_DECORATOR

#define ECONV_XML_ATTR_CONTENT_DECORATOR RUBY_ECONV_XML_ATTR_CONTENT_DECORATOR

Definition at line 397 of file encoding.h.

## ◆ ECONV_XML_ATTR_QUOTE_DECORATOR

#define ECONV_XML_ATTR_QUOTE_DECORATOR RUBY_ECONV_XML_ATTR_QUOTE_DECORATOR

Definition at line 399 of file encoding.h.

## ◆ ECONV_XML_TEXT_DECORATOR

#define ECONV_XML_TEXT_DECORATOR RUBY_ECONV_XML_TEXT_DECORATOR

Definition at line 396 of file encoding.h.

## ◆ ENC_CODERANGE

#define ENC_CODERANGE | ( |  | obj | ) | RB_ENC_CODERANGE(obj)

Definition at line 97 of file encoding.h.

## ◆ ENC_CODERANGE_7BIT

#define ENC_CODERANGE_7BIT RUBY_ENC_CODERANGE_7BIT

Definition at line 93 of file encoding.h.

## ◆ ENC_CODERANGE_AND

#define ENC_CODERANGE_AND | ( |  | a,
|  |  | b
| ) |  | RB_ENC_CODERANGE_AND(a, b)

Definition at line 101 of file encoding.h.

## ◆ ENC_CODERANGE_ASCIIONLY

#define ENC_CODERANGE_ASCIIONLY | ( |  | obj | ) | RB_ENC_CODERANGE_ASCIIONLY(obj)

Definition at line 98 of file encoding.h.

## ◆ ENC_CODERANGE_BROKEN

#define ENC_CODERANGE_BROKEN RUBY_ENC_CODERANGE_BROKEN

Definition at line 95 of file encoding.h.

## ◆ ENC_CODERANGE_CLEAN_P

#define ENC_CODERANGE_CLEAN_P | ( |  | cr | ) | RB_ENC_CODERANGE_CLEAN_P(cr)

Definition at line 96 of file encoding.h.

## ◆ ENC_CODERANGE_CLEAR

#define ENC_CODERANGE_CLEAR | ( |  | obj | ) | RB_ENC_CODERANGE_CLEAR(obj)

Definition at line 100 of file encoding.h.

## ◆ ENC_CODERANGE_MASK

#define ENC_CODERANGE_MASK RUBY_ENC_CODERANGE_MASK

Definition at line 91 of file encoding.h.

## ◆ ENC_CODERANGE_SET

#define ENC_CODERANGE_SET | ( |  | obj,
|  |  | cr
| ) |  | RB_ENC_CODERANGE_SET(obj,cr)

Definition at line 99 of file encoding.h.

## ◆ ENC_CODERANGE_UNKNOWN

#define ENC_CODERANGE_UNKNOWN RUBY_ENC_CODERANGE_UNKNOWN

Definition at line 92 of file encoding.h.

## ◆ ENC_CODERANGE_VALID

#define ENC_CODERANGE_VALID RUBY_ENC_CODERANGE_VALID

Definition at line 94 of file encoding.h.

## ◆ ENCODING_CODERANGE_SET

#define ENCODING_CODERANGE_SET | ( |  | obj,
|  |  | encindex,
|  |  | cr
| ) |  | RB_ENCODING_CODERANGE_SET(obj, encindex, cr)

Definition at line 102 of file encoding.h.

## ◆ ENCODING_GET

#define ENCODING_GET | ( |  | obj | ) | RB_ENCODING_GET(obj)

Definition at line 51 of file encoding.h.

## ◆ ENCODING_GET_INLINED

#define ENCODING_GET_INLINED | ( |  | obj | ) | RB_ENCODING_GET_INLINED(obj)

Definition at line 50 of file encoding.h.

## ◆ ENCODING_INLINE_MAX

#define ENCODING_INLINE_MAX RUBY_ENCODING_INLINE_MAX

Definition at line 29 of file encoding.h.

## ◆ ENCODING_IS_ASCII8BIT

#define ENCODING_IS_ASCII8BIT | ( |  | obj | ) | RB_ENCODING_IS_ASCII8BIT(obj)

Definition at line 52 of file encoding.h.

## ◆ ENCODING_MASK

#define ENCODING_MASK RUBY_ENCODING_MASK

Definition at line 31 of file encoding.h.

## ◆ ENCODING_MAXNAMELEN

#define ENCODING_MAXNAMELEN RUBY_ENCODING_MAXNAMELEN

Definition at line 53 of file encoding.h.

## ◆ ENCODING_SET

#define ENCODING_SET | ( |  | obj,
|  |  | i
| ) |  | RB_ENCODING_SET(obj,i)

Definition at line 49 of file encoding.h.

## ◆ ENCODING_SET_INLINED

#define ENCODING_SET_INLINED | ( |  | obj,
|  |  | i
| ) |  | RB_ENCODING_SET_INLINED(obj,i)

Definition at line 48 of file encoding.h.

## ◆ ENCODING_SHIFT

#define ENCODING_SHIFT RUBY_ENCODING_SHIFT

Definition at line 30 of file encoding.h.

## ◆ MBCLEN_CHARFOUND_LEN

#define MBCLEN_CHARFOUND_LEN | ( |  | ret | ) | ONIGENC_MBCLEN_CHARFOUND_LEN(ret)

Definition at line 183 of file encoding.h.

## ◆ MBCLEN_CHARFOUND_P

#define MBCLEN_CHARFOUND_P | ( |  | ret | ) | ONIGENC_MBCLEN_CHARFOUND_P(ret)

Definition at line 182 of file encoding.h.

## ◆ MBCLEN_INVALID_P

#define MBCLEN_INVALID_P | ( |  | ret | ) | ONIGENC_MBCLEN_INVALID_P(ret)

Definition at line 184 of file encoding.h.

## ◆ MBCLEN_NEEDMORE_LEN

#define MBCLEN_NEEDMORE_LEN | ( |  | ret | ) | ONIGENC_MBCLEN_NEEDMORE_LEN(ret)

Definition at line 186 of file encoding.h.

## ◆ MBCLEN_NEEDMORE_P

#define MBCLEN_NEEDMORE_P | ( |  | ret | ) | ONIGENC_MBCLEN_NEEDMORE_P(ret)

Definition at line 185 of file encoding.h.

## ◆ rb_enc_asciicompat

#define rb_enc_asciicompat | ( |  | enc | ) | rb_enc_asciicompat_inline(enc)

Definition at line 236 of file encoding.h.

## ◆ rb_enc_code_to_mbclen

#define rb_enc_code_to_mbclen | ( |  | c,
|  |  | enc
| ) |  | ONIGENC_CODE_TO_MBCLEN((enc), (c));

Definition at line 205 of file encoding.h.

## ◆ rb_enc_codepoint

#define rb_enc_codepoint | ( |  | p,
|  |  | e,
|  |  | enc
| ) |  | rb_enc_codepoint_len((p),(e),0,(enc))

Definition at line 198 of file encoding.h.

## ◆ RB_ENC_CODERANGE

#define RB_ENC_CODERANGE | ( |  | obj | ) | ((int)RBASIC(obj)->flags & RUBY_ENC_CODERANGE_MASK)

Definition at line 71 of file encoding.h.

## ◆ RB_ENC_CODERANGE_AND

#define RB_ENC_CODERANGE_AND | ( |  | a,
|  |  | b
| ) |  |

Value:
((a) == RUBY_ENC_CODERANGE_7BIT ? (b) : \
(a) != RUBY_ENC_CODERANGE_VALID ? RUBY_ENC_CODERANGE_UNKNOWN : \
(b) == RUBY_ENC_CODERANGE_7BIT ? RUBY_ENC_CODERANGE_VALID : (b))
RUBY_ENC_CODERANGE_VALID
@ RUBY_ENC_CODERANGE_VALID
Definition: encoding.h:58
RUBY_ENC_CODERANGE_7BIT
@ RUBY_ENC_CODERANGE_7BIT
Definition: encoding.h:57
RUBY_ENC_CODERANGE_UNKNOWN
@ RUBY_ENC_CODERANGE_UNKNOWN
Definition: encoding.h:56

Definition at line 79 of file encoding.h.

## ◆ RB_ENC_CODERANGE_ASCIIONLY

#define RB_ENC_CODERANGE_ASCIIONLY | ( |  | obj | ) | (RB_ENC_CODERANGE(obj) == RUBY_ENC_CODERANGE_7BIT)

Definition at line 72 of file encoding.h.

## ◆ RB_ENC_CODERANGE_CLEAN_P

#define RB_ENC_CODERANGE_CLEAN_P | ( |  | cr | ) | rb_enc_coderange_clean_p(cr)

Definition at line 70 of file encoding.h.

## ◆ RB_ENC_CODERANGE_CLEAR

#define RB_ENC_CODERANGE_CLEAR | ( |  | obj | ) | RB_ENC_CODERANGE_SET((obj),0)

Definition at line 76 of file encoding.h.

## ◆ RB_ENC_CODERANGE_SET

#define RB_ENC_CODERANGE_SET | ( |  | obj,
|  |  | cr
| ) |  |

Value:
(\
RBASIC(obj)->flags = \
(RBASIC(obj)->flags & ~RUBY_ENC_CODERANGE_MASK) | (cr))
RBASIC
#define RBASIC(obj)
Definition: rbasic.h:34

Definition at line 73 of file encoding.h.

## ◆ rb_enc_is_newline

#define rb_enc_is_newline | ( |  | p,
|  |  | end,
|  |  | enc
| ) |  | ONIGENC_IS_MBC_NEWLINE((enc),(UChar*)(p),(UChar*)(end))

Definition at line 218 of file encoding.h.

## ◆ rb_enc_isalnum

#define rb_enc_isalnum | ( |  | c,
|  |  | enc
| ) |  | ONIGENC_IS_CODE_ALNUM((enc),(c))

Definition at line 226 of file encoding.h.

## ◆ rb_enc_isalpha

#define rb_enc_isalpha | ( |  | c,
|  |  | enc
| ) |  | ONIGENC_IS_CODE_ALPHA((enc),(c))

Definition at line 222 of file encoding.h.

## ◆ rb_enc_isascii

#define rb_enc_isascii | ( |  | c,
|  |  | enc
| ) |  | ONIGENC_IS_CODE_ASCII(c)

Definition at line 221 of file encoding.h.

## ◆ rb_enc_isctype

#define rb_enc_isctype | ( |  | c,
|  |  | t,
|  |  | enc
| ) |  | ONIGENC_IS_CODE_CTYPE((enc),(c),(t))

Definition at line 220 of file encoding.h.

## ◆ rb_enc_isdigit

#define rb_enc_isdigit | ( |  | c,
|  |  | enc
| ) |  | ONIGENC_IS_CODE_DIGIT((enc),(c))

Definition at line 229 of file encoding.h.

## ◆ rb_enc_islower

#define rb_enc_islower | ( |  | c,
|  |  | enc
| ) |  | ONIGENC_IS_CODE_LOWER((enc),(c))

Definition at line 223 of file encoding.h.

## ◆ rb_enc_isprint

#define rb_enc_isprint | ( |  | c,
|  |  | enc
| ) |  | ONIGENC_IS_CODE_PRINT((enc),(c))

Definition at line 227 of file encoding.h.

## ◆ rb_enc_ispunct

#define rb_enc_ispunct | ( |  | c,
|  |  | enc
| ) |  | ONIGENC_IS_CODE_PUNCT((enc),(c))

Definition at line 225 of file encoding.h.

## ◆ rb_enc_isspace

#define rb_enc_isspace | ( |  | c,
|  |  | enc
| ) |  | ONIGENC_IS_CODE_SPACE((enc),(c))

Definition at line 228 of file encoding.h.

## ◆ rb_enc_isupper

#define rb_enc_isupper | ( |  | c,
|  |  | enc
| ) |  | ONIGENC_IS_CODE_UPPER((enc),(c))

Definition at line 224 of file encoding.h.

## ◆ rb_enc_left_char_head

#define rb_enc_left_char_head | ( |  | s,
|  |  | p,
|  |  | e,
|  |  | enc
| ) |  | ((char *)onigenc_get_left_adjust_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))

Definition at line 213 of file encoding.h.

## ◆ rb_enc_mbc_to_codepoint

#define rb_enc_mbc_to_codepoint | ( |  | p,
|  |  | e,
|  |  | enc
| ) |  | ONIGENC_MBC_TO_CODE((enc),(UChar*)(p),(UChar*)(e))

Definition at line 199 of file encoding.h.

## ◆ rb_enc_mbcput

#define rb_enc_mbcput | ( |  | c,
|  |  | buf,
|  |  | enc
| ) |  | ONIGENC_CODE_TO_MBC((enc),(c),(UChar*)(buf))

Definition at line 208 of file encoding.h.

## ◆ rb_enc_mbmaxlen

#define rb_enc_mbmaxlen | ( |  | enc | ) | (enc)->max_enc_len

Definition at line 172 of file encoding.h.

## ◆ rb_enc_mbminlen

#define rb_enc_mbminlen | ( |  | enc | ) | (enc)->min_enc_len

Definition at line 171 of file encoding.h.

## ◆ rb_enc_name

#define rb_enc_name | ( |  | enc | ) | (enc)->name

Definition at line 168 of file encoding.h.

## ◆ rb_enc_prev_char

#define rb_enc_prev_char | ( |  | s,
|  |  | p,
|  |  | e,
|  |  | enc
| ) |  | ((char *)onigenc_get_prev_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))

Definition at line 211 of file encoding.h.

## ◆ rb_enc_right_char_head

#define rb_enc_right_char_head | ( |  | s,
|  |  | p,
|  |  | e,
|  |  | enc
| ) |  | ((char *)onigenc_get_right_adjust_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))

Definition at line 214 of file encoding.h.

## ◆ rb_enc_step_back

#define rb_enc_step_back | ( |  | s,
|  |  | p,
|  |  | e,
|  |  | n,
|  |  | enc
| ) |  | ((char *)onigenc_step_back((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e),(int)(n)))

Definition at line 215 of file encoding.h.

## ◆ rb_enc_str_asciicompat_p

#define rb_enc_str_asciicompat_p | ( |  | str | ) | rb_enc_asciicompat(rb_enc_get(str))

Definition at line 248 of file encoding.h.

## ◆ RB_ENCODING_CODERANGE_SET

#define RB_ENCODING_CODERANGE_SET | ( |  | obj,
|  |  | encindex,
|  |  | cr
| ) |  |

Value:
do { \
VALUE rb_encoding_coderange_obj = (obj); \
RB_ENCODING_SET(rb_encoding_coderange_obj, (encindex)); \
RB_ENC_CODERANGE_SET(rb_encoding_coderange_obj, (cr)); \
} while (0)
VALUE
unsigned long VALUE
Definition: value.h:38

Definition at line 84 of file encoding.h.

## ◆ RB_ENCODING_GET

#define RB_ENCODING_GET | ( |  | obj | ) |

Value:
(RB_ENCODING_GET_INLINED(obj) != RUBY_ENCODING_INLINE_MAX ? \
RB_ENCODING_GET_INLINED(obj) : \
rb_enc_get_index(obj))
rb_enc_get_index
int rb_enc_get_index(VALUE obj)
Definition: encoding.c:977
RUBY_ENCODING_INLINE_MAX
@ RUBY_ENCODING_INLINE_MAX
Definition: encoding.h:22
RB_ENCODING_GET_INLINED
#define RB_ENCODING_GET_INLINED(obj)
Definition: encoding.h:39

Definition at line 41 of file encoding.h.

## ◆ RB_ENCODING_GET_INLINED

#define RB_ENCODING_GET_INLINED | ( |  | obj | ) | (int)((RBASIC(obj)->flags & RUBY_ENCODING_MASK)>>RUBY_ENCODING_SHIFT)

Definition at line 39 of file encoding.h.

## ◆ RB_ENCODING_IS_ASCII8BIT

#define RB_ENCODING_IS_ASCII8BIT | ( |  | obj | ) | (RB_ENCODING_GET_INLINED(obj) == 0)

Definition at line 46 of file encoding.h.

## ◆ RB_ENCODING_SET

#define RB_ENCODING_SET | ( |  | obj,
|  |  | i
| ) |  | rb_enc_set_index((obj), (i))

Definition at line 37 of file encoding.h.

## ◆ RB_ENCODING_SET_INLINED

#define RB_ENCODING_SET_INLINED | ( |  | obj,
|  |  | i
| ) |  |

Value:
do {\
RBASIC(obj)->flags &= ~RUBY_ENCODING_MASK;\
RBASIC(obj)->flags |= (VALUE)(i) << RUBY_ENCODING_SHIFT;\
} while (0)
RUBY_ENCODING_SHIFT
@ RUBY_ENCODING_SHIFT
Definition: encoding.h:23

Definition at line 33 of file encoding.h.

## Typedef Documentation

## ◆ rb_econv_t

typedef struct rb_econv_t rb_econv_t

Definition at line 298 of file encoding.h.

## ◆ rb_encoding

typedef const OnigEncodingType rb_encoding

Definition at line 104 of file encoding.h.

## Enumeration Type Documentation

## ◆ rb_econv_result_t

enum rb_econv_result_t

Enumerator
econv_invalid_byte_sequence |
econv_undefined_conversion |
econv_destination_buffer_full |
econv_source_buffer_empty |
econv_finished |
econv_after_output |
econv_incomplete_input |

Definition at line 288 of file encoding.h.

## ◆ ruby_coderange_type

enum ruby_coderange_type

Enumerator
RUBY_ENC_CODERANGE_UNKNOWN |
RUBY_ENC_CODERANGE_7BIT |
RUBY_ENC_CODERANGE_VALID |
RUBY_ENC_CODERANGE_BROKEN |
RUBY_ENC_CODERANGE_MASK |

Definition at line 55 of file encoding.h.

## ◆ ruby_econv_flag_type

enum ruby_econv_flag_type

Enumerator
RUBY_ECONV_ERROR_HANDLER_MASK |
RUBY_ECONV_INVALID_MASK |
RUBY_ECONV_INVALID_REPLACE |
RUBY_ECONV_UNDEF_MASK |
RUBY_ECONV_UNDEF_REPLACE |
RUBY_ECONV_UNDEF_HEX_CHARREF |
RUBY_ECONV_DECORATOR_MASK |
RUBY_ECONV_NEWLINE_DECORATOR_MASK |
RUBY_ECONV_NEWLINE_DECORATOR_READ_MASK |
RUBY_ECONV_NEWLINE_DECORATOR_WRITE_MASK |
RUBY_ECONV_UNIVERSAL_NEWLINE_DECORATOR |
RUBY_ECONV_CRLF_NEWLINE_DECORATOR |
RUBY_ECONV_CR_NEWLINE_DECORATOR |
RUBY_ECONV_XML_TEXT_DECORATOR |
RUBY_ECONV_XML_ATTR_CONTENT_DECORATOR |
RUBY_ECONV_STATEFUL_DECORATOR_MASK |
RUBY_ECONV_XML_ATTR_QUOTE_DECORATOR |
RUBY_ECONV_DEFAULT_NEWLINE_DECORATOR |
RUBY_ECONV_PARTIAL_INPUT |
RUBY_ECONV_AFTER_OUTPUT |
RUBY_ECONV_FLAGS_PLACEHOLDER |

Definition at line 352 of file encoding.h.

## ◆ ruby_encoding_consts

enum ruby_encoding_consts

Enumerator
RUBY_ENCODING_INLINE_MAX |
RUBY_ENCODING_SHIFT |
RUBY_ENCODING_MASK |
RUBY_ENCODING_MAXNAMELEN |

Definition at line 21 of file encoding.h.

## Function Documentation

## ◆ rb_ascii8bit_encindex()

int rb_ascii8bit_encindex | ( | void |  | ) |

Definition at line 1531 of file encoding.c.

References ENCINDEX_ASCII.

## ◆ rb_ascii8bit_encoding()

rb_encoding * rb_ascii8bit_encoding | ( | void |  | ) |

Definition at line 1525 of file encoding.c.

Referenced by rb_define_dummy_encoding(), rb_encdb_dummy(), rb_glob(), rb_io_extract_modeenc(), rb_reg_fragment_setenc(), rb_reg_new(), rb_str_conv_enc_opts(), rb_symname_p(), ruby_brace_glob(), ruby_glob(), and ruby_init_loadpath().

## ◆ rb_char_to_option_kcode()

int rb_char_to_option_kcode | ( | int | c,
|  | int * | option,
|  | int * | kcode
| ) |  |

Definition at line 329 of file re.c.

References ARG_ENCODING_FIXED, ARG_ENCODING_NONE, ENCINDEX_EUC_JP, ENCINDEX_Windows_31J, rb_ascii8bit_encindex, and rb_utf8_encindex.

Referenced by rb_reg_fragment_setenc().

## ◆ rb_check_id_cstr()

ID rb_check_id_cstr | ( | const char * | ptr,
|  | long | len,
|  | rb_encoding * | enc
| ) |  |

Definition at line 1155 of file symbol.c.

References len, name, ptr, and rb_setup_fake_str().

Referenced by rb_deprecate_constant(), rb_iv_get(), and rb_path_to_class().

## ◆ rb_check_symbol_cstr()

VALUE rb_check_symbol_cstr | ( | const char * | ptr,
|  | long | len,
|  | rb_encoding * | enc
| ) |  |

Definition at line 1166 of file symbol.c.

References len, name, ptr, Qnil, rb_setup_fake_str(), and sym.

Referenced by rb_str_format().

## ◆ rb_default_external_encoding()

rb_encoding * rb_default_external_encoding | ( | void |  | ) |

Definition at line 1647 of file encoding.c.

References default_encoding::enc, default_encoding::index, rb_enc_from_index(), and rb_locale_encoding().

Referenced by Init_enc_set_filesystem_encoding(), rb_enc_default_external(), rb_external_str_new(), rb_external_str_new_cstr(), rb_inspect(), rb_str_export(), rb_str_inspect(), rb_str_quote_unprintable(), and rb_str_symname_p().

## ◆ rb_default_internal_encoding()

rb_encoding * rb_default_internal_encoding | ( | void |  | ) |

Definition at line 1734 of file encoding.c.

References default_encoding::enc, default_encoding::index, and rb_enc_from_index().

Referenced by rb_enc_default_internal(), rb_external_str_new_with_enc(), rb_external_str_with_enc(), rb_inspect(), rb_str_inspect(), rb_str_quote_unprintable(), rb_str_symname_p(), and rsock_raise_socket_error().

## ◆ rb_define_dummy_encoding()

int rb_define_dummy_encoding | ( | const char * | name | ) |

Definition at line 616 of file encoding.c.

References rb_encoding_entry::enc, ENC_SET_DUMMY, GLOBAL_ENC_TABLE_ENTER, GLOBAL_ENC_TABLE_LEAVE, name, and rb_ascii8bit_encoding().

Referenced by rb_nkf_enc_get().

## ◆ rb_econv_append()

VALUE rb_econv_append | ( | rb_econv_t * | ec,
|  | const char * | bytesrc,
|  | long | bytesize,
|  | VALUE | dst,
|  | int | flags
| ) |  |

Definition at line 1805 of file transcode.c.

References rb_econv_t::destination_encoding, dp, econv_destination_buffer_full, rb_econv_t::last_tc, len, long(), LONG_MAX, rb_transcoder::max_output, NIL_P, rb_eArgError, rb_econv_check_error(), rb_econv_convert(), rb_enc_associate(), rb_raise(), rb_str_buf_new(), rb_str_capacity(), rb_str_resize(), rb_str_set_len(), RSTRING_LEN, RSTRING_PTR, and rb_transcoding::transcoder.

Referenced by rb_econv_substr_append().

## ◆ rb_econv_asciicompat_encoding()

const char * rb_econv_asciicompat_encoding | ( | const char * | encname | ) |

Definition at line 1778 of file transcode.c.

References asciicompat_encoding_t::ascii_compat_name, asciicompat_encoding_t::ascii_incompat_name, NULL, st_table::num_entries, st_foreach, and st_lookup.

## ◆ rb_econv_binmode()

void rb_econv_binmode | ( | rb_econv_t * | ec | ) |

Definition at line 1934 of file transcode.c.

References ECONV_CR_NEWLINE_DECORATOR, ECONV_CRLF_NEWLINE_DECORATOR, ECONV_NEWLINE_DECORATOR_MASK, ECONV_UNIVERSAL_NEWLINE_DECORATOR, rb_econv_t::elems, rb_econv_t::flags, rb_econv_t::num_trans, rb_econv_elem_t::out_buf_start, rb_econv_elem_t::tc, rb_transcoding::transcoder, transcoder_entry_t::transcoder, and xfree.

Referenced by rb_io_binmode().

## ◆ rb_econv_check_error()

void rb_econv_check_error | ( | rb_econv_t * | ec | ) |

Definition at line 4246 of file transcode.c.

References rb_econv_init_by_convpath_t::ec, NIL_P, and rb_exc_raise().

Referenced by rb_econv_append().

## ◆ rb_econv_close()

void rb_econv_close | ( | rb_econv_t * | ec | ) |

Definition at line 1694 of file transcode.c.

References rb_econv_t::elems, rb_econv_t::in_buf_start, rb_econv_t::num_trans, rb_econv_elem_t::out_buf_start, rb_econv_t::replacement_allocated, rb_econv_t::replacement_str, rb_econv_elem_t::tc, and xfree.

Referenced by rb_econv_open(), and rb_econv_open_opts().

## ◆ rb_econv_convert()

rb_econv_result_t rb_econv_convert | ( | rb_econv_t * | ec,
|  | const unsigned char ** | source_buffer_ptr,
|  | const unsigned char * | source_buffer_end,
|  | unsigned char ** | destination_buffer_ptr,
|  | unsigned char * | destination_buffer_end,
|  | int | flags
| ) |  |

Definition at line 1438 of file transcode.c.

References econv_incomplete_input, econv_invalid_byte_sequence, ECONV_INVALID_MASK, ECONV_INVALID_REPLACE, ECONV_UNDEF_HEX_CHARREF, ECONV_UNDEF_MASK, ECONV_UNDEF_REPLACE, econv_undefined_conversion, rb_econv_t::flags, and rb_econv_t::started.

Referenced by rb_econv_append().

## ◆ rb_econv_decorate_at_first()

int rb_econv_decorate_at_first | ( | rb_econv_t * | ec,
|  | const char * | decorator_name
| ) |  |

Definition at line 1900 of file transcode.c.

References asciicompat_decoder, DECORATOR_P, rb_econv_t::elems, rb_econv_t::num_trans, rb_econv_elem_t::tc, and rb_transcoding::transcoder.

## ◆ rb_econv_decorate_at_last()

int rb_econv_decorate_at_last | ( | rb_econv_t * | ec,
|  | const char * | decorator_name
| ) |  |

Definition at line 1917 of file transcode.c.

References asciicompat_encoder, DECORATOR_P, rb_econv_t::elems, rb_econv_t::num_trans, rb_econv_elem_t::tc, and rb_transcoding::transcoder.

Referenced by rb_econv_open().

## ◆ rb_econv_encoding_to_insert_output()

const char * rb_econv_encoding_to_insert_output | ( | rb_econv_t * | ec | ) |

Definition at line 1495 of file transcode.c.

References asciicompat_encoder, rb_econv_t::last_tc, NULL, and rb_transcoding::transcoder.

Referenced by rb_econv_insert_output(), and rb_econv_set_replacement().

## ◆ rb_econv_has_convpath_p()

int rb_econv_has_convpath_p | ( | const char * | from_encoding,
|  | const char * | to_encoding
| ) |  |

Definition at line 3189 of file transcode.c.

References Qnil, and RTEST.

Referenced by rb_w32_write_console().

## ◆ rb_econv_insert_output()

int rb_econv_insert_output | ( | rb_econv_t * | ec,
|  | const unsigned char * | str,
|  | size_t | len,
|  | const char * | str_encoding
| ) |  |

Definition at line 1579 of file transcode.c.

References asciicompat_encoder, rb_transcoder::asciicompat_type, rb_econv_t::elems, encoding_equal, fail, rb_econv_t::in_buf_end, rb_econv_t::in_buf_start, rb_econv_t::in_data_end, rb_econv_t::in_data_start, len, memcpy, MEMMOVE, NULL, rb_econv_t::num_trans, rb_econv_elem_t::out_buf_end, rb_econv_elem_t::out_buf_start, rb_econv_elem_t::out_data_end, rb_econv_elem_t::out_data_start, rb_econv_encoding_to_insert_output(), rb_transcoding::readagain_len, rb_transcoding::recognized_len, rb_econv_t::started, str, rb_econv_elem_t::tc, rb_transcoding::transcoder, TRANSCODING_READBUF, xfree, xmalloc, and xrealloc.

## ◆ rb_econv_make_exception()

VALUE rb_econv_make_exception | ( | rb_econv_t * | ec | ) |

Definition at line 4240 of file transcode.c.

References rb_econv_init_by_convpath_t::ec.

## ◆ rb_econv_open()

rb_econv_t * rb_econv_open | ( | const char * | source_encoding,
|  | const char * | destination_encoding,
|  | int | ecflags
| ) |  |

Definition at line 1061 of file transcode.c.

References ECONV_ERROR_HANDLER_MASK, rb_econv_t::flags, MAX_ECFLAGS_DECORATORS, NULL, rb_econv_close(), and rb_econv_decorate_at_last().

Referenced by rb_econv_open_opts().

## ◆ rb_econv_open_exc()

VALUE rb_econv_open_exc | ( | const char * | senc,
|  | const char * | denc,
|  | int | ecflags
| ) |  |

Definition at line 2028 of file transcode.c.

References rb_exc_new3, rb_str_cat2, and rb_str_new_cstr.

## ◆ rb_econv_open_opts()

rb_econv_t * rb_econv_open_opts | ( | const char * | source_encoding,
|  | const char * | destination_encoding,
|  | int | ecflags,
|  | VALUE | ecopts
| ) |  |

Definition at line 2577 of file transcode.c.

References NIL_P, NULL, OBJ_FROZEN, Qnil, rb_bug(), rb_econv_close(), rb_econv_open(), rb_econv_set_replacement(), rb_enc_get(), rb_enc_name, rb_hash_aref(), RSTRING_LEN, RSTRING_PTR, and T_HASH.

## ◆ rb_econv_prepare_options()

int rb_econv_prepare_options | ( | VALUE | opthash,
|  | VALUE * | ecopts,
|  | int | ecflags
| ) |  |

Definition at line 2526 of file transcode.c.

References ENC_CODERANGE_BROKEN, idAREF, NIL_P, Qnil, rb_check_hash_type(), rb_eArgError, rb_enc_get(), rb_enc_name, rb_enc_str_coderange(), rb_hash_aref(), rb_hash_aset(), rb_hash_freeze(), rb_hash_new(), rb_obj_is_method(), rb_obj_is_proc(), rb_raise(), rb_respond_to(), rb_str_dump(), rb_str_new_frozen(), StringValue, and StringValueCStr.

Referenced by rb_econv_prepare_opts(), and rb_io_extract_modeenc().

## ◆ rb_econv_prepare_opts()

int rb_econv_prepare_opts | ( | VALUE | opthash,
|  | VALUE * | ecopts
| ) |  |

Definition at line 2571 of file transcode.c.

References rb_econv_prepare_options().

## ◆ rb_econv_putback()

void rb_econv_putback | ( | rb_econv_t * | ec,
|  | unsigned char * | p,
|  | int | n
| ) |  |

Definition at line 1745 of file transcode.c.

References rb_econv_t::elems, memcpy, rb_econv_t::num_trans, rb_transcoding::readagain_len, rb_transcoding::recognized_len, rb_econv_elem_t::tc, and TRANSCODING_READBUF.

## ◆ rb_econv_putbackable()

int rb_econv_putbackable | ( | rb_econv_t * | ec | ) |

Definition at line 1734 of file transcode.c.

References rb_econv_t::elems, rb_econv_t::num_trans, rb_transcoding::readagain_len, and rb_econv_elem_t::tc.

## ◆ rb_econv_set_replacement()

int rb_econv_set_replacement | ( | rb_econv_t * | ec,
|  | const unsigned char * | str,
|  | size_t | len,
|  | const char * | encname
| ) |  |

Definition at line 2190 of file transcode.c.

References encoding_equal, len, MEMCPY, NULL, rb_econv_encoding_to_insert_output(), rb_econv_t::replacement_allocated, rb_econv_t::replacement_enc, rb_econv_t::replacement_len, rb_econv_t::replacement_str, str, xfree, and xmalloc.

Referenced by rb_econv_open_opts().

## ◆ rb_econv_str_append()

VALUE rb_econv_str_append | ( | rb_econv_t * | ec,
|  | VALUE | src,
|  | VALUE | dst,
|  | int | flags
| ) |  |

Definition at line 1857 of file transcode.c.

References rb_econv_substr_append(), and RSTRING_LEN.

## ◆ rb_econv_str_convert()

VALUE rb_econv_str_convert | ( | rb_econv_t * | ec,
|  | VALUE | src,
|  | int | flags
| ) |  |

Definition at line 1869 of file transcode.c.

References Qnil, rb_econv_substr_append(), and RSTRING_LEN.

## ◆ rb_econv_substr_append()

VALUE rb_econv_substr_append | ( | rb_econv_t * | ec,
|  | VALUE | src,
|  | long | byteoff,
|  | long | bytesize,
|  | VALUE | dst,
|  | int | flags
| ) |  |

Definition at line 1848 of file transcode.c.

References len, rb_econv_append(), RB_GC_GUARD, rb_str_new_frozen(), and RSTRING_PTR.

Referenced by rb_econv_str_append(), rb_econv_str_convert(), and rb_econv_substr_convert().

## ◆ rb_econv_substr_convert()

VALUE rb_econv_substr_convert | ( | rb_econv_t * | ec,
|  | VALUE | src,
|  | long | byteoff,
|  | long | bytesize,
|  | int | flags
| ) |  |

Definition at line 1863 of file transcode.c.

References Qnil, and rb_econv_substr_append().

## ◆ rb_enc_alias()

int rb_enc_alias | ( | const char * | alias,
|  | const char * | orig
| ) |  |

Definition at line 720 of file encoding.c.

References alias, GLOBAL_ENC_TABLE_ENTER, GLOBAL_ENC_TABLE_LEAVE, and rb_enc_find_index().

## ◆ rb_enc_ascget()

int rb_enc_ascget | ( | const char * | p,
|  | const char * | e,
|  | int * | len,
|  | rb_encoding * | enc
| ) |  |

Definition at line 1242 of file encoding.c.

References rb_encoding_entry::enc, ISASCII, len, MBCLEN_CHARFOUND_P, rb_enc_asciicompat, rb_enc_isascii, rb_enc_mbc_to_codepoint, and rb_enc_precise_mbclen().

Referenced by rb_reg_quote(), and rb_str_end_with_asciichar().

## ◆ rb_enc_associate()

VALUE rb_enc_associate | ( | VALUE | obj,
|  | rb_encoding * | enc
| ) |  |

Definition at line 1064 of file encoding.c.

References rb_encoding_entry::enc, rb_enc_associate_index(), and rb_enc_to_index().

Referenced by rb_ary_join(), rb_econv_append(), rb_enc_str_new(), rb_enc_vsprintf(), rb_file_expand_path_internal(), rb_reg_fragment_setenc(), rb_reg_quote(), rb_str_conv_enc_opts(), rb_str_ellipsize(), rb_str_format(), rb_str_initialize(), rb_str_inspect(), rb_str_intern(), and rb_str_update().

## ◆ rb_enc_associate_index()

VALUE rb_enc_associate_index | ( | VALUE | obj,
|  | int | idx
| ) |  |

Definition at line 1036 of file encoding.c.

References rb_encoding_entry::enc, ENC_CODERANGE_ASCIIONLY, ENC_CODERANGE_CLEAR, rb_check_frozen, rb_eArgError, rb_enc_asciicompat, rb_enc_from_index(), rb_enc_get_index(), rb_enc_mbminlen, rb_raise(), rb_str_change_terminator_length(), SPECIAL_CONST_P, and T_STRING.

Referenced by rb_dir_getwd(), rb_enc_associate(), rb_enc_copy(), rb_external_str_with_enc(), rb_find_file(), rb_find_file_ext(), rb_str_concat(), rb_str_dump(), rb_utf8_str_new(), and rb_utf8_str_new_cstr().

## ◆ rb_enc_capable()

int rb_enc_capable | ( | VALUE | obj | ) |

Definition at line 941 of file encoding.c.

## ◆ rb_enc_casefold()

int rb_enc_casefold | ( | char * | to,
|  | const char * | p,
|  | const char * | e,
|  | rb_encoding * | enc
| ) |  |

## ◆ rb_enc_check()

rb_encoding * rb_enc_check | ( | VALUE | str1,
|  | VALUE | str2
| ) |  |

Definition at line 1089 of file encoding.c.

References rb_encoding_entry::enc, rb_eEncCompatError, rb_enc_compatible(), rb_enc_get(), rb_enc_name, and rb_raise().

Referenced by rb_file_expand_path_internal(), rb_str_format(), rb_str_update(), and rb_str_upto_each().

## ◆ rb_enc_code_to_mbclen()

int rb_enc_code_to_mbclen | ( | int | code,
|  | rb_encoding * | enc
| ) |  |

Definition at line 1298 of file encoding.c.

References rb_encoding_entry::enc, and ONIGENC_CODE_TO_MBCLEN.

## ◆ rb_enc_codelen()

int rb_enc_codelen | ( | int | code,
|  | rb_encoding * | enc
| ) |  |

Definition at line 1287 of file encoding.c.

References rb_encoding_entry::enc, ONIGENC_CODE_TO_MBCLEN, rb_eArgError, rb_enc_name, and rb_raise().

Referenced by rb_enc_uint_chr(), rb_str_buf_cat_ascii(), rb_str_concat(), and rb_str_format().

## ◆ rb_enc_codepoint()

unsigned int rb_enc_codepoint | ( | const char * | p,
|  | const char * | e,
|  | rb_encoding * | enc
| ) |  |

Definition at line 1281 of file encoding.c.

References rb_encoding_entry::enc, and rb_enc_codepoint_len().

## ◆ rb_enc_codepoint_len()

unsigned int rb_enc_codepoint_len | ( | const char * | p,
|  | const char * | e,
|  | int * | len,
|  | rb_encoding * | enc
| ) |  |

Definition at line 1266 of file encoding.c.

References rb_encoding_entry::enc, MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, rb_eArgError, rb_enc_mbc_to_codepoint, rb_enc_name, rb_enc_precise_mbclen(), and rb_raise().

Referenced by rb_enc_codepoint(), and rb_str_format().

## ◆ rb_enc_compatible()

rb_encoding * rb_enc_compatible | ( | VALUE | str1,
|  | VALUE | str2
| ) |  |

Definition at line 1172 of file encoding.c.

References rb_enc_from_index(), and rb_enc_get_index().

Referenced by rb_enc_check().

## ◆ rb_enc_copy()

void rb_enc_copy | ( | VALUE | dst,
|  | VALUE | src
| ) |  |

Definition at line 1188 of file encoding.c.

References rb_enc_associate_index(), and rb_enc_get_index().

Referenced by rb_file_dirname(), rb_file_expand_path_internal(), rb_reg_quote(), rb_str_concat_literals(), and rb_str_times().

## ◆ rb_enc_default_external()

VALUE rb_enc_default_external | ( | void |  | ) |

Definition at line 1661 of file encoding.c.

References rb_default_external_encoding(), and rb_enc_from_encoding().

## ◆ rb_enc_default_internal()

VALUE rb_enc_default_internal | ( | void |  | ) |

Definition at line 1743 of file encoding.c.

References rb_default_internal_encoding(), and rb_enc_from_encoding().

## ◆ rb_enc_dummy_p()

int rb_enc_dummy_p | ( | rb_encoding * | enc | ) |

Definition at line 203 of file encoding.c.

References rb_encoding_entry::enc, and ENC_DUMMY_P.

## ◆ rb_enc_fast_mbclen()

int rb_enc_fast_mbclen | ( | const char * | p,
|  | const char * | e,
|  | rb_encoding * | enc
| ) |  |

Definition at line 1212 of file encoding.c.

References rb_encoding_entry::enc, ONIGENC_MBC_ENC_LEN, and UChar.

## ◆ rb_enc_find()

rb_encoding * rb_enc_find | ( | const char * | name | ) |

Definition at line 916 of file encoding.c.

References name, rb_enc_find_index(), and rb_enc_from_index().

## ◆ rb_enc_find_index()

int rb_enc_find_index | ( | const char * | name | ) |

Definition at line 879 of file encoding.c.

References rb_encoding_entry::enc, GLOBAL_ENC_TABLE_EVAL, name, rb_eArgError, rb_enc_autoload(), rb_enc_autoload_p, rb_enc_from_index(), rb_raise(), rb_warn(), and UNSPECIFIED_ENCODING.

Referenced by Init_enc_set_filesystem_encoding(), rb_enc_alias(), rb_enc_find(), rb_enc_find_index2(), rb_nkf_enc_get(), and rb_to_encoding_index().

## ◆ rb_enc_from_encoding()

VALUE rb_enc_from_encoding | ( | rb_encoding * | enc | ) |

Definition at line 188 of file encoding.c.

References ENC_TO_ENCINDEX, and Qnil.

Referenced by Init_nkf(), rb_enc_default_external(), rb_enc_default_internal(), rb_io_extract_encoding_option(), rb_parser_encoding(), and rb_str_ellipsize().

## ◆ rb_enc_from_index()

rb_encoding * rb_enc_from_index | ( | int | idx | ) |

Definition at line 414 of file encoding.c.

References rb_encoding_entry::enc, ENCINDEX_ASCII, ENCINDEX_US_ASCII, ENCINDEX_UTF_8, and GLOBAL_ENC_TABLE_EVAL.

Referenced by rb_default_external_encoding(), rb_default_internal_encoding(), rb_enc_associate_index(), rb_enc_compatible(), rb_enc_find(), rb_enc_find_index(), rb_enc_get(), rb_enc_register(), rb_enc_set_base(), rb_enc_str_coderange(), rb_encdb_declare(), rb_encdb_replicate(), rb_encdb_set_unicode(), rb_filesystem_encoding(), rb_find_encoding(), rb_io_extract_encoding_option(), rb_locale_encoding(), rb_nkf_enc_get(), rb_str_buf_cat_ascii(), rb_str_comparable(), rb_str_dump(), rb_str_encode_ospath(), rb_str_end_with_asciichar(), rb_str_escape(), rb_str_inspect(), rb_w32_conv_from_wchar(), rb_w32_set_thread_description_str(), rb_w32_write_console(), and RUBY_ALIAS_FUNCTION().

## ◆ rb_enc_get()

rb_encoding * rb_enc_get | ( | VALUE | obj | ) |

Definition at line 1070 of file encoding.c.

References rb_enc_from_index(), and rb_enc_get_index().

Referenced by ole_vstr2wc(), rb_econv_open_opts(), rb_econv_prepare_options(), rb_enc_check(), rb_enc_check_str(), rb_file_dirname(), rb_file_expand_path_internal(), rb_home_dir_of(), rb_inspect(), rb_io_extract_encoding_option(), rb_io_extract_modeenc(), rb_must_asciicompat(), rb_path_to_class(), rb_readlink(), rb_realpath_internal(), rb_reg_check_preprocess(), rb_reg_quote(), rb_reg_regsub(), rb_str_cat_conv_enc_opts(), rb_str_conv_enc_opts(), rb_str_ellipsize(), rb_str_format(), rb_str_intern(), and rb_to_encoding_index().

## ◆ rb_enc_get_index()

int rb_enc_get_index | ( | VALUE | obj | ) |

Definition at line 977 of file encoding.c.

References BUILTIN_TYPE, is_data_encoding, is_obj_encoding, NIL_P, rb_funcallv, rb_intern(), rb_sym2str(), SPECIAL_CONST_P, SYMBOL_P, T_DATA, T_FILE, T_REGEXP, T_STRING, and T_SYMBOL.

Referenced by rb_enc_associate_index(), rb_enc_compatible(), rb_enc_copy(), rb_enc_get(), rb_obj_encoding(), rb_str_dump(), rb_str_opt_plus(), and rb_w32_set_thread_description_str().

## ◆ rb_enc_interned_str()

VALUE rb_enc_interned_str | ( | const char * | ptr,
|  | long | len,
|  | rb_encoding * | enc
| ) |  |

Definition at line 11562 of file string.c.

References len, ptr, rb_enc_autoload(), rb_enc_autoload_p, rb_setup_fake_str(), TRUE, and UNLIKELY.

Referenced by rb_enc_interned_str_cstr().

## ◆ rb_enc_interned_str_cstr()

VALUE rb_enc_interned_str_cstr | ( | const char * | ptr,
|  | rb_encoding * | enc
| ) |  |

Definition at line 11573 of file string.c.

References ptr, rb_enc_interned_str(), and strlen().

## ◆ rb_enc_mbclen()

int rb_enc_mbclen | ( | const char * | p,
|  | const char * | e,
|  | rb_encoding * | enc
| ) |  |

Definition at line 1218 of file encoding.c.

References rb_encoding_entry::enc, int(), MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, ONIGENC_PRECISE_MBC_ENC_LEN, rb_enc_mbminlen, and UChar.

Referenced by rb_enc_symname_type(), and rb_str_format().

## ◆ rb_enc_nth()

char * rb_enc_nth | ( | const char * | p,
|  | const char * | e,
|  | long | nth,
|  | rb_encoding * | enc
| ) |  |

Definition at line 2538 of file string.c.

Referenced by rb_str_ellipsize(), and rb_str_format().

## ◆ rb_enc_path_end()

char * rb_enc_path_end | ( | const char * | path,
|  | const char * | end,
|  | rb_encoding * | enc
| ) |  |

Definition at line 3504 of file file.c.

References isdirsep.

## ◆ rb_enc_path_last_separator()

char * rb_enc_path_last_separator | ( | const char * | path,
|  | const char * | end,
|  | rb_encoding * | enc
| ) |  |

Definition at line 3470 of file file.c.

References Inc, isdirsep, last, and NULL.

Referenced by ruby_init_loadpath().

## ◆ rb_enc_path_next()

char * rb_enc_path_next | ( | const char * | s,
|  | const char * | e,
|  | rb_encoding * | enc
| ) |  |

Definition at line 3422 of file file.c.

References Inc, and isdirsep.

Referenced by rb_enc_path_skip_prefix().

## ◆ rb_enc_path_skip_prefix()

char * rb_enc_path_skip_prefix | ( | const char * | path,
|  | const char * | end,
|  | rb_encoding * | enc
| ) |  |

Definition at line 3436 of file file.c.

References isdirsep, and rb_enc_path_next().

## ◆ rb_enc_precise_mbclen()

int rb_enc_precise_mbclen | ( | const char * | p,
|  | const char * | e,
|  | rb_encoding * | enc
| ) |  |

Definition at line 1230 of file encoding.c.

References rb_encoding_entry::enc, ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE, ONIGENC_PRECISE_MBC_ENC_LEN, and UChar.

Referenced by rb_enc_ascget(), rb_enc_codepoint_len(), rb_enc_strlen_cr(), rb_enc_uint_chr(), rb_str_coderange_scan_restartable(), rb_str_concat(), rb_str_dump(), rb_str_escape(), and rb_str_inspect().

## ◆ rb_enc_reg_new()

VALUE rb_enc_reg_new | ( | const char * | s,
|  | long | len,
|  | rb_encoding * | enc,
|  | int | options
| ) |  |

Definition at line 2946 of file re.c.

References err, len, NULL, rb_enc_str_new(), rb_fstring(), RB_OBJ_WRITE, rb_reg_alloc(), RREGEXP, and RRegexp::src.

Referenced by rb_reg_new().

## ◆ rb_enc_replicate()

int rb_enc_replicate | ( | const char * | name,
|  | rb_encoding * | encoding
| ) |  |

Definition at line 549 of file encoding.c.

References GLOBAL_ENC_TABLE_EVAL, and name.

## ◆ rb_enc_set_default_external()

void rb_enc_set_default_external | ( | VALUE | encoding | ) |

Definition at line 1701 of file encoding.c.

References NIL_P, rb_eArgError, and rb_raise().

## ◆ rb_enc_set_default_internal()

void rb_enc_set_default_internal | ( | VALUE | encoding | ) |

Definition at line 1784 of file encoding.c.

## ◆ rb_enc_set_index()

void rb_enc_set_index | ( | VALUE | obj,
|  | int | encindex
| ) |  |

Definition at line 1028 of file encoding.c.

References rb_check_frozen.

Referenced by rb_str_concat_literals().

## ◆ rb_enc_sprintf()

VALUE rb_enc_sprintf | ( | rb_encoding * | enc,
|  | const char * | format,
|  |  | ...
| ) |  |

Definition at line 1184 of file sprintf.c.

References rb_enc_vsprintf().

Referenced by rb_str_format(), rb_str_upto_each(), and rb_str_upto_endless_each().

## ◆ rb_enc_str_asciionly_p()

int rb_enc_str_asciionly_p | ( | VALUE | str | ) |

Definition at line 739 of file string.c.

References ENC_CODERANGE_7BIT, FALSE, rb_enc_asciicompat, rb_enc_str_coderange(), str, STR_ENC_GET, and TRUE.

Referenced by rb_file_expand_path_internal(), rb_inspect(), and rb_reg_quote().

## ◆ rb_enc_str_buf_cat()

VALUE rb_enc_str_buf_cat | ( | VALUE | str,
|  | const char * | ptr,
|  | long | len,
|  | rb_encoding * | enc
| ) |  |

Definition at line 3072 of file string.c.

References ENC_CODERANGE_UNKNOWN, len, NULL, ptr, rb_enc_to_index(), and str.

Referenced by rb_reg_regsub().

## ◆ rb_enc_str_coderange()

int rb_enc_str_coderange | ( | VALUE | str | ) |

Definition at line 725 of file string.c.

References ENC_CODERANGE, ENC_CODERANGE_SET, ENC_CODERANGE_UNKNOWN, ENCODING_GET, rb_enc_from_index(), and str.

Referenced by rb_econv_prepare_options(), rb_enc_str_asciionly_p(), rb_external_str_with_enc(), rb_file_expand_path_internal(), rb_reg_fragment_setenc(), rb_str_comparable(), rb_str_hash(), and RUBY_ALIAS_FUNCTION().

## ◆ rb_enc_str_new()

VALUE rb_enc_str_new | ( | const char * | ptr,
|  | long | len,
|  | rb_encoding * | enc
| ) |  |

Definition at line 857 of file string.c.

References len, ptr, rb_cString, rb_enc_associate(), rb_enc_mbminlen, rb_str_new, and str.

Referenced by rb_enc_reg_new(), rb_enc_str_new_cstr(), rb_enc_uint_chr(), rb_external_str_new_with_enc(), rb_intern3(), rb_readlink(), rb_str_upto_each(), rb_strftime(), rb_strftime_timespec(), rb_syntax_error_append(), and rb_w32_conv_from_wchar().

## ◆ rb_enc_str_new_cstr()

VALUE rb_enc_str_new_cstr | ( | const char * | ptr,
|  | rb_encoding * | enc
| ) |  |

Definition at line 897 of file string.c.

References ptr, rb_eArgError, rb_enc_mbminlen, rb_enc_str_new(), rb_raise(), and strlen().

## ◆ rb_enc_str_new_static()

VALUE rb_enc_str_new_static | ( | const char * | ptr,
|  | long | len,
|  | rb_encoding * | enc
| ) |  |

Definition at line 951 of file string.c.

References len, ptr, rb_cString, and rb_enc_to_index().

## ◆ rb_enc_strlen()

long rb_enc_strlen | ( | const char * | p,
|  | const char * | e,
|  | rb_encoding * | enc
| ) |  |

Definition at line 1887 of file string.c.

References ENC_CODERANGE_UNKNOWN.

Referenced by rb_str_format().

## ◆ rb_enc_symname2_p()

int rb_enc_symname2_p | ( | const char * | name,
|  | long | len,
|  | rb_encoding * | enc
| ) |  |

Definition at line 407 of file symbol.c.

References IDSET_ATTRSET_FOR_SYNTAX, len, name, and rb_enc_symname_type().

Referenced by rb_enc_symname_p(), and rb_str_symname_p().

## ◆ rb_enc_symname_p()

int rb_enc_symname_p | ( | const char * | name,
|  | rb_encoding * | enc
| ) |  |

Definition at line 203 of file symbol.c.

References name, rb_enc_symname2_p(), and strlen().

Referenced by rb_symname_p().

## ◆ rb_enc_to_index()

int rb_enc_to_index | ( | rb_encoding * | enc | ) |

Definition at line 197 of file encoding.c.

References rb_encoding_entry::enc, and ENC_TO_ENCINDEX.

Referenced by Init_enc_set_filesystem_encoding(), rb_dir_getwd(), rb_enc_associate(), rb_enc_str_buf_cat(), rb_enc_str_coderange_scan(), rb_enc_str_new_static(), rb_external_str_new_with_enc(), rb_external_str_with_enc(), rb_setup_fake_str(), rb_str_coderange_scan_restartable(), rb_str_concat(), rb_str_plus(), rb_w32_conv_from_wchar(), and rb_w32_readdir().

## ◆ rb_enc_tolower()

int rb_enc_tolower | ( | int | c,
|  | rb_encoding * | enc
| ) |  |

Definition at line 1310 of file encoding.c.

References ONIGENC_ASCII_CODE_TO_LOWER_CASE, and ONIGENC_IS_ASCII_CODE.

## ◆ rb_enc_toupper()

int rb_enc_toupper | ( | int | c,
|  | rb_encoding * | enc
| ) |  |

Definition at line 1304 of file encoding.c.

References ONIGENC_ASCII_CODE_TO_UPPER_CASE, and ONIGENC_IS_ASCII_CODE.

Referenced by rb_str_format().

## ◆ rb_enc_uint_chr()

VALUE rb_enc_uint_chr | ( | unsigned int | code,
|  | rb_encoding * | enc
| ) |  |

Definition at line 3391 of file numeric.c.

References ONIGERR_INVALID_CODE_POINT_VALUE, ONIGERR_TOO_BIG_WIDE_CHAR_VALUE, rb_enc_codelen(), rb_enc_mbcput, rb_enc_name, rb_enc_precise_mbclen(), rb_enc_str_new(), rb_eRangeError, rb_raise(), RSTRING_PTR, and str.

Referenced by rb_io_ungetc().

## ◆ rb_enc_unicode_p()

int rb_enc_unicode_p | ( | rb_encoding * | enc | ) |

Definition at line 688 of file encoding.c.

References rb_encoding_entry::enc, and ONIGENC_IS_UNICODE.

Referenced by rb_str_escape(), and rb_str_inspect().

## ◆ rb_enc_vsprintf()

VALUE rb_enc_vsprintf | ( | rb_encoding * | enc,
|  | const char * | fmt,
|  | va_list | ap
| ) |  |

Definition at line 1151 of file sprintf.c.

References __SSTR, __SWR, f, rb_cString, rb_eArgError, rb_enc_associate(), rb_enc_mbminlen, rb_enc_name, rb_raise(), rb_str_buf_new(), rb_str_resize(), RSTRING_PTR, and rb_printf_buffer_extra::value.

Referenced by rb_enc_raise(), rb_enc_sprintf(), rb_loaderror(), rb_loaderror_with_path(), and rb_vsprintf().

## ◆ rb_external_str_new_with_enc()

VALUE rb_external_str_new_with_enc | ( | const char * | ptr,
|  | long | len,
|  | rb_encoding * | eenc
| ) |  |

Definition at line 1106 of file string.c.

References len, NIL_P, NULL, ptr, Qnil, rb_ascii8bit_encindex, rb_default_internal_encoding(), rb_enc_asciicompat, rb_enc_str_new(), rb_enc_to_index(), rb_str_cat_conv_enc_opts(), rb_str_initialize(), rb_str_new, rb_usascii_encindex, and str.

Referenced by rb_external_str_new(), rb_external_str_new_cstr(), rb_filesystem_str_new(), rb_filesystem_str_new_cstr(), rb_locale_str_new(), and rb_locale_str_new_cstr().

## ◆ rb_filesystem_encindex()

int rb_filesystem_encindex | ( | void |  | ) |

Definition at line 1589 of file encoding.c.

References ENCINDEX_ASCII, and GLOBAL_ENC_TABLE_EVAL.

Referenced by rb_filesystem_encoding(), and rb_str_encode_ospath().

## ◆ rb_filesystem_encoding()

rb_encoding * rb_filesystem_encoding | ( | void |  | ) |

Definition at line 1602 of file encoding.c.

References rb_enc_from_index(), and rb_filesystem_encindex().

Referenced by rb_default_home_dir(), rb_dir_getwd(), rb_file_expand_path_internal(), rb_filesystem_str_new(), rb_filesystem_str_new_cstr(), rb_home_dir_of(), and rb_w32_special_folder().

## ◆ rb_find_encoding()

rb_encoding * rb_find_encoding | ( | VALUE | enc | ) |

Definition at line 336 of file encoding.c.

References rb_encoding_entry::enc, NULL, rb_enc_from_index(), and RDATA.

## ◆ rb_intern3()

ID rb_intern3 | ( | const char * | name,
|  | long | len,
|  | rb_encoding * | enc
| ) |  |

Definition at line 714 of file symbol.c.

References len, name, OBJ_FREEZE, rb_enc_str_new(), rb_setup_fake_str(), rb_sym2id(), str, and sym.

Referenced by rb_intern2().

## ◆ rb_interned_id_p()

ID rb_interned_id_p | ( | const char * | ,
|  | long | ,
|  | rb_encoding * |
| ) |  |

## ◆ rb_locale_charmap()

VALUE rb_locale_charmap | ( | VALUE | klass | ) |

Definition at line 91 of file localeinit.c.

References Qnil, and rb_usascii_str_new_cstr.

Referenced by Init_Encoding().

## ◆ rb_locale_encindex()

int rb_locale_encindex | ( | void |  | ) |

Definition at line 1563 of file encoding.c.

References ENCINDEX_UTF_8, GLOBAL_ENC_TABLE_ENTER, GLOBAL_ENC_TABLE_LEAVE, Init_w32_codepage(), and rb_locale_charmap_index().

Referenced by rb_locale_encoding().

## ◆ rb_locale_encoding()

rb_encoding * rb_locale_encoding | ( | void |  | ) |

Definition at line 1583 of file encoding.c.

References rb_enc_from_index(), and rb_locale_encindex().

Referenced by rb_default_external_encoding(), rb_loaderror(), rb_loaderror_with_path(), rb_locale_str_new(), rb_locale_str_new_cstr(), and rb_str_export_locale().

## ◆ rb_memsearch()

long rb_memsearch | ( | const void * | x0,
|  | long | m,
|  | const void * | y0,
|  | long | n,
|  | rb_encoding * | enc
| ) |  |

Definition at line 247 of file re.c.

References LIKELY, memcmp(), rb_enc_mbminlen, rb_utf8_encoding(), and SIZEOF_VALUE.

## ◆ rb_obj_encoding()

VALUE rb_obj_encoding | ( | VALUE | obj | ) |

Definition at line 1202 of file encoding.c.

References ENC_INDEX_MASK, rb_enc_get_index(), rb_eTypeError, and rb_raise().

Referenced by Init_Regexp(), and Init_String().

## ◆ rb_str_coderange_scan_restartable()

long rb_str_coderange_scan_restartable | ( | const char * | s,
|  | const char * | e,
|  | rb_encoding * | enc,
|  | int * | cr
| ) |  |

Definition at line 617 of file string.c.

References ENC_CODERANGE_7BIT, ENC_CODERANGE_BROKEN, ENC_CODERANGE_UNKNOWN, ENC_CODERANGE_VALID, MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, MBCLEN_INVALID_P, rb_ascii8bit_encindex, rb_enc_asciicompat, rb_enc_precise_mbclen(), and rb_enc_to_index().

Referenced by rb_str_format().

## ◆ rb_str_conv_enc()

VALUE rb_str_conv_enc | ( | VALUE | str,
|  | rb_encoding * | from,
|  | rb_encoding * | to
| ) |  |

Definition at line 1100 of file string.c.

References Qnil, rb_str_conv_enc_opts(), and str.

Referenced by rb_dir_getwd(), rb_external_str_with_enc(), rb_home_dir_of(), rb_str_encode_ospath(), rb_str_export(), rb_str_export_locale(), rb_str_export_to_enc(), and rb_w32_set_thread_description_str().

## ◆ rb_str_conv_enc_opts()

VALUE rb_str_conv_enc_opts | ( | VALUE | str,
|  | rb_encoding * | from,
|  | rb_encoding * | to,
|  | int | ecflags,
|  | VALUE | ecopts
| ) |  |

Definition at line 984 of file string.c.

References len, NIL_P, ptr, rb_ascii8bit_encoding(), rb_enc_asciicompat, rb_enc_associate(), rb_enc_get(), rb_str_buf_new(), rb_str_dup(), RSTRING_GETMEM, str, and STR_ENC_GET.

Referenced by rb_str_conv_enc(), rb_w32_conv_from_wchar(), and rb_w32_write_console().

## ◆ rb_str_encode()

VALUE rb_str_encode | ( | VALUE | str,
|  | VALUE | to,
|  | int | ecflags,
|  | VALUE | ecopts
| ) |  |

Definition at line 2892 of file transcode.c.

References argc, argv, and str.

Referenced by rb_str_ellipsize().

## ◆ rb_str_export_to_enc()

VALUE rb_str_export_to_enc | ( | VALUE | str,
|  | rb_encoding * | enc
| ) |  |

Definition at line 1205 of file string.c.

References rb_str_conv_enc(), str, and STR_ENC_GET.

## ◆ rb_to_encoding()

rb_encoding * rb_to_encoding | ( | VALUE | enc | ) |

Definition at line 329 of file encoding.c.

References rb_encoding_entry::enc, and RDATA.

Referenced by rb_io_extract_encoding_option().

## ◆ rb_to_encoding_index()

int rb_to_encoding_index | ( | VALUE | enc | ) |

Definition at line 267 of file encoding.c.

References rb_encoding_entry::enc, name, NIL_P, rb_check_string_type(), rb_enc_asciicompat, rb_enc_find_index(), rb_enc_get(), and rb_str_to_cstr().

Referenced by rb_io_extract_encoding_option().

## ◆ rb_usascii_encindex()

int rb_usascii_encindex | ( | void |  | ) |

Definition at line 1555 of file encoding.c.

References ENCINDEX_US_ASCII.

## ◆ rb_usascii_encoding()

rb_encoding * rb_usascii_encoding | ( | void |  | ) |

Definition at line 1549 of file encoding.c.

Referenced by rb_ary_join(), rb_intern2(), rb_iv_get(), rb_reg_fragment_setenc(), rb_reg_quote(), rb_str_inspect(), rb_str_intern(), rb_str_upto_each(), rb_str_upto_endless_each(), and rb_sym_intern_ascii().

## ◆ rb_utf8_encindex()

int rb_utf8_encindex | ( | void |  | ) |

Definition at line 1543 of file encoding.c.

References ENCINDEX_UTF_8.

## ◆ rb_utf8_encoding()

rb_encoding * rb_utf8_encoding | ( | void |  | ) |

Definition at line 1537 of file encoding.c.

Referenced by Init_nkf(), rb_file_expand_path_internal(), rb_home_dir_of(), rb_memsearch(), rb_str_encode_ospath(), rb_str_subpos(), and rb_w32_set_thread_description_str().

## ◆ ruby_enc_find_basename()

const char * ruby_enc_find_basename | ( | const char * | name,
|  | long * | baselen,
|  | long * | alllen,
|  | rb_encoding * | enc
| ) |  |

Definition at line 4589 of file file.c.

References f, Inc, isdirsep, name, root, skipprefix, strlen(), and strrdirsep.

## ◆ ruby_enc_find_extname()

const char * ruby_enc_find_extname | ( | const char * | name,
|  | long * | len,
|  | rb_encoding * | enc
| ) |  |

Definition at line 4786 of file file.c.

References Inc, isADS, isdirsep, istrailinggarbage, last, len, long(), name, strlen(), and strrdirsep.

## Variable Documentation

## ◆ rb_cEncoding

VALUE rb_cEncoding
| extern

Definition at line 57 of file encoding.c.