Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/kconv.rb

Instance Method Summary collapse

Instance Method Details

#iseucObject

call-seq:

String#iseuc   => true or false

Returns whether self‘s encoding is EUC-JP or not.



263
# File 'lib/kconv.rb', line 263

def iseuc;	Kconv.iseuc(self) end

#isjisObject

call-seq:

String#isjis   => true or false

Returns whether self‘s encoding is ISO-2022-JP or not.



275
# File 'lib/kconv.rb', line 275

def isjis;	Kconv.isjis(self) end

#issjisObject

call-seq:

String#issjis   => true or false

Returns whether self‘s encoding is Shift_JIS or not.



269
# File 'lib/kconv.rb', line 269

def issjis;	Kconv.issjis(self) end

#isutf8Object

call-seq:

String#isutf8   => true or false

Returns whether self‘s encoding is UTF-8 or not.



281
# File 'lib/kconv.rb', line 281

def isutf8;	Kconv.isutf8(self) end

#kconv(to_enc, from_enc = nil) ⇒ Object

call-seq:

String#kconv(to_enc, from_enc)

Convert self to to_enc. to_enc and from_enc are given as constants of Kconv or Encoding objects.



204
205
206
207
# File 'lib/kconv.rb', line 204

def kconv(to_enc, from_enc=nil)
  from_enc = self.encoding if !from_enc && self.encoding != Encoding.list[0]
  Kconv::kconv(self, to_enc, from_enc)
end

#toeucObject

call-seq:

String#toeuc   => string

Convert self to EUC-JP



223
# File 'lib/kconv.rb', line 223

def toeuc; Kconv.toeuc(self) end

#tojisObject

call-seq:

String#tojis   => string

Convert self to ISO-2022-JP



217
# File 'lib/kconv.rb', line 217

def tojis; Kconv.tojis(self) end

#tolocaleObject

call-seq:

String#tolocale   => string

Convert self to locale encoding



253
# File 'lib/kconv.rb', line 253

def tolocale; Kconv.tolocale(self) end

#tosjisObject

call-seq:

String#tosjis   => string

Convert self to Shift_JIS



229
# File 'lib/kconv.rb', line 229

def tosjis; Kconv.tosjis(self) end

#toutf16Object

call-seq:

String#toutf16   => string

Convert self to UTF-16



241
# File 'lib/kconv.rb', line 241

def toutf16; Kconv.toutf16(self) end

#toutf32Object

call-seq:

String#toutf32   => string

Convert self to UTF-32



247
# File 'lib/kconv.rb', line 247

def toutf32; Kconv.toutf32(self) end

#toutf8Object

call-seq:

String#toutf8   => string

Convert self to UTF-8



235
# File 'lib/kconv.rb', line 235

def toutf8; Kconv.toutf8(self) end