Topic awaiting preservation: String size in bytes? (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: Australia |
posted 11-20-2006 05:40
Hi All, |
Maniac (V) Mad Scientist From: :morF |
posted 11-20-2006 08:56
Before it leaves yur mailserver, it's already encoded in whatever character set you've specified. Headers are added (and more and more are added along its bounce-path, and if it's scanned for spam or viruses at the other end, so on...), one of which specifies the character encoding, and it's sent out via an SMTP connection, server-to-server. code: $size = ($messagelength + $headers) *16;
|
Maniac (V) Mad Scientist with Finglongers From: Germany |
posted 11-20-2006 13:19
Think you're missing a / 2, Skarrjj . |
Maniac (V) Mad Scientist From: :morF |
posted 11-21-2006 00:30
Uhh... yeah, I am. code: $size = ($messagelength + $headers) *($utf8size / 8);
|
Paranoid (IV) Inmate From: Australia |
posted 11-22-2006 01:52
Hmm, code: mb_strlen(mb_encode_mimeheader($newsletterRichText,'ISO-8859-1', 'Q')) |
Maniac (V) Mad Scientist with Finglongers From: Germany |
posted 11-22-2006 08:24
No it doesn't! |
Paranoid (IV) Inmate From: Norway |
posted 11-22-2006 08:29
UTF-8 uses 1 to 4 bytes per character. quote: |
Maniac (V) Mad Scientist From: :morF |
posted 11-22-2006 10:08
Yeah, after my exams, and a hectic couple of weeks, I am officially braindead. I'll leave the hard-line pronouncements to the living, I think. |
Paranoid (IV) Inmate From: Australia |
posted 11-23-2006 07:26
Hmm yeah i thought so, so is there a function that will calculate the size based on the UTF-8 or whichever encoding I use per character? code: $size = ($messagelength + $headers) *($utf8size / 8);
|
Paranoid (IV) Inmate From: Australia |
posted 11-23-2006 07:35
Here is what i actually have in a test. |
Paranoid (IV) Inmate From: Australia |
posted 11-23-2006 07:48
From what I can tell I should only have byte characters, so the content should take 698 bytes. |
Paranoid (IV) Inmate From: Australia |
posted 11-23-2006 07:48
From what I can tell I should only have byte characters, so the content should take 698 bytes. |