[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

String utf8 size in kilobytes

daniel wijnands

1/5/2006 11:06:00 AM

I have a mimemessage in a string.
This string is utf8, i would like to know the size of this string.
String.size gives me the length in characters, but i need the size in kb
or bytes

--
Posted via http://www.ruby-....


3 Answers

Andreas S.

1/5/2006 12:45:00 PM

0

daniel wijnands wrote:
> I have a mimemessage in a string.
> This string is utf8, i would like to know the size of this string.
> String.size gives me the length in characters, but i need the size in kb
> or bytes

String#size returns the size in bytes. String#jsize returns the number
of characters (with require 'jcode').

--
Posted via http://www.ruby-....


daniel wijnands

1/5/2006 12:48:00 PM

0

Thanks, then my method is valid, i want to know the bytes, so that's
fine :)

Andreas S. wrote:
> daniel wijnands wrote:
>> I have a mimemessage in a string.
>> This string is utf8, i would like to know the size of this string.
>> String.size gives me the length in characters, but i need the size in kb
>> or bytes
>
> String#size returns the size in bytes. String#jsize returns the number
> of characters (with require 'jcode').


--
Posted via http://www.ruby-....


Roland van Gaalen

9/18/2010 1:29:00 PM

0

Meanwhile, a controversy concerning science and the Neanderthal conservative
movement in Canada even reached the Dutch press:

<< The Harper government has tightened the muzzle on federal scientists,
going so far as to control when and what they can say about floods at the
end of the last ice age.>> (see link below)

It appears that in Canada the Palin crowd is in charge of the country -- a
number of weeks ago the head of Statistics Canada resigned in protest
concerning political interference with the national census.

See:

http://www.vancouversun.com/news/Tightened+muzzle+scientists+Orwel...
45/story.html
--
Roland van Gaalen
Amsterdam
R.P.vanGaalenATchello.nl