Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > String utf8 size in kilobytes

Reply
Thread Tools

String utf8 size in kilobytes

 
 
daniel wijnands
Guest
Posts: n/a
 
      01-05-2006
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-forum.com/.


 
Reply With Quote
 
 
 
 
Andreas S.
Guest
Posts: n/a
 
      01-05-2006
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-forum.com/.


 
Reply With Quote
 
 
 
 
daniel wijnands
Guest
Posts: n/a
 
      01-05-2006
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-forum.com/.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
given char* utf8, how to read unicode line by line, and output utf8 gry C++ 2 03-13-2012 04:32 AM
decreasing Kilobytes tmont22 General Computer Support 0 06-23-2009 12:27 PM
Preferred Size, Minimum Size, Size Jason Cavett Java 5 05-25-2008 08:32 AM
mega pixels, file size, image size, and print size - Adobe Evangelists Frank ess Digital Photography 0 11-14-2006 05:08 PM
Does Thunderbird allow downloading only first x kilobytes of email? RDL Firefox 16 10-03-2005 11:53 AM



Advertisments