D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Encoding
/
Converter
/
Filename :
primitive_convert-i.ri
back
Copy
U:RDoc::AnyMethod[iI"primitive_convert:ETI"*Encoding::Converter#primitive_convert;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"possible opt elements:;To:RDoc::Markup::Verbatim; [I"hash form: ;TI"U :partial_input => true # source buffer may be part of larger source ;TI"T :after_output => true # stop conversion after output before input ;TI"integer form: ;TI"* Encoding::Converter::PARTIAL_INPUT ;TI") Encoding::Converter::AFTER_OUTPUT ;T:@format0o; ; [I"possible results:;To;; [I":invalid_byte_sequence ;TI":incomplete_input ;TI":undefined_conversion ;TI":after_output ;TI":destination_buffer_full ;TI":source_buffer_empty ;TI":finished ;T;0o; ; [I"Fprimitive_convert converts source_buffer into destination_buffer.;To:RDoc::Markup::BlankLine o; ; [I".source_buffer should be a string or nil. ;TI"nil means an empty string.;T@%o; ; [I"+destination_buffer should be a string.;T@%o; ; [I"9destination_byteoffset should be an integer or nil. ;TI".nil means the end of destination_buffer. ;TI"&If it is omitted, nil is assumed.;T@%o; ; [I"7destination_bytesize should be an integer or nil. ;TI"nil means unlimited. ;TI"&If it is omitted, nil is assumed.;T@%o; ; [I".opt should be nil, a hash or an integer. ;TI"nil means no flags. ;TI"&If it is omitted, nil is assumed.;T@%o; ; [I"Lprimitive_convert converts the content of source_buffer from beginning ;TI"2and store the result into destination_buffer.;T@%o; ; [I"Ndestination_byteoffset and destination_bytesize specify the region which ;TI"%the converted result is stored. ;TI"Ydestination_byteoffset specifies the start position in destination_buffer in bytes. ;TI"'If destination_byteoffset is nil, ;TI"Cdestination_buffer.bytesize is used for appending the result. ;TI"=destination_bytesize specifies maximum number of bytes. ;TI"%If destination_bytesize is nil, ;TI"$destination size is unlimited. ;TI"8After conversion, destination_buffer is resized to ;TI"Adestination_byteoffset + actually produced number of bytes. ;TI"GAlso destination_buffer's encoding is set to destination_encoding.;T@%o; ; [I"Bprimitive_convert drops the converted part of source_buffer. ;TI"<the dropped part is converted in destination_buffer or ;TI",buffered in Encoding::Converter object.;T@%o; ; [I"Lprimitive_convert stops conversion when one of following condition met.;To:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o; ; [I"Kinvalid byte sequence found in source buffer (:invalid_byte_sequence) ;TI"R+primitive_errinfo+ and +last_error+ methods returns the detail of the error.;To;;0; [o; ; [I"9unexpected end of source buffer (:incomplete_input) ;TI";this occur only when :partial_input is not specified. ;TI"R+primitive_errinfo+ and +last_error+ methods returns the detail of the error.;To;;0; [o; ; [I"Lcharacter not representable in output encoding (:undefined_conversion) ;TI"R+primitive_errinfo+ and +last_error+ methods returns the detail of the error.;To;;0; [o; ; [I"Jafter some output is generated, before input is done (:after_output) ;TI"5this occur only when :after_output is specified.;To;;0; [o; ; [I";destination buffer is full (:destination_buffer_full) ;TI":this occur only when destination_bytesize is non-nil.;To;;0; [o; ; [I"3source buffer is empty (:source_buffer_empty) ;TI"6this occur only when :partial_input is specified.;To;;0; [o; ; [I"'conversion is finished (:finished);T@%o; ; [I" example:;To;; [I"7ec = Encoding::Converter.new("UTF-8", "UTF-16BE") ;TI"<ret = ec.primitive_convert(src="pi", dst="", nil, 100) ;TI"9p [ret, src, dst] #=> [:finished, "", "\x00p\x00i"] ;TI" ;TI"7ec = Encoding::Converter.new("UTF-8", "UTF-16BE") ;TI":ret = ec.primitive_convert(src="pi", dst="", nil, 1) ;TI"Cp [ret, src, dst] #=> [:destination_buffer_full, "i", "\x00"] ;TI"5ret = ec.primitive_convert(src, dst="", nil, 1) ;TI"?p [ret, src, dst] #=> [:destination_buffer_full, "", "p"] ;TI"5ret = ec.primitive_convert(src, dst="", nil, 1) ;TI"Bp [ret, src, dst] #=> [:destination_buffer_full, "", "\x00"] ;TI"5ret = ec.primitive_convert(src, dst="", nil, 1) ;TI"/p [ret, src, dst] #=> [:finished, "", "i"];T;0: @fileI"transcode.c;T:0@omit_headings_from_table_of_contents_below0I"�ec.primitive_convert(source_buffer, destination_buffer) -> symbol ec.primitive_convert(source_buffer, destination_buffer, destination_byteoffset) -> symbol ec.primitive_convert(source_buffer, destination_buffer, destination_byteoffset, destination_bytesize) -> symbol ec.primitive_convert(source_buffer, destination_buffer, destination_byteoffset, destination_bytesize, opt) -> symbol ;T0[ I"1(p1, p2, p3 = v3, p4 = v4, p5 = v5, p6 = {});T@�FI"Converter;TcRDoc::NormalClass00