Page 1 of 1
Anyone know what this is called?
Posted: Thu Nov 23, 2006 1:32 pm
by Chris Corbyn
Code: Select all
Content-Type: text/plain; charset=utf-8
If you were going to give the "charset=utf-8" part above a name, what would it be? I'm not sure it has a technical term and is just considered part of the overall header but I need to think of a logical name for it so I can make a method:
Code: Select all
$mime->setHeader("Content-Type", "text/plain");
$mime->set?????("Content-Type", "charset", "utf-8");
Ideas?
I've tossed around the ideas of:
setHeaderTag()
setHeaderValue()
setSubHeader()
None of them feel quite right and some feel too close to the meaning of setHeader().
EDIT | Maybe setHeaderNameValuePair() ? Ack.
Re: Anyone know what this is called?
Posted: Thu Nov 23, 2006 2:07 pm
by alex.barylski
d11wtq wrote:Code: Select all
Content-Type: text/plain; charset=utf-8
If you were going to give the "charset=utf-8" part above a name, what would it be? I'm not sure it has a technical term and is just considered part of the overall header but I need to think of a logical name for it so I can make a method:
Code: Select all
$mime->setHeader("Content-Type", "text/plain");
$mime->set?????("Content-Type", "charset", "utf-8");
Ideas?
I've tossed around the ideas of:
setHeaderTag()
setHeaderValue()
setSubHeader()
None of them feel quite right and some feel too close to the meaning of setHeader().
EDIT | Maybe setHeaderNameValuePair() ? Ack.
setCharSet() or setCharEncoding()
I'm unclear as to what you are trying to accomplish. You already have a low-level method called setHeader() but you want a specialized method for setting (what I assume are sub-properties/headers of Content-Type?) name - value pairs which are strictly bound to the header Content-Type???
Code: Select all
setContentType('text/plain', array(array('charset', 'utf-8'), array('test', 'test')));
I'm shooting in the dark here so pardon if this is redudant for you
Cheers

Posted: Thu Nov 23, 2006 2:28 pm
by nickvd
the charset= part reminds me of an Attribute...
Posted: Thu Nov 23, 2006 2:36 pm
by brendandonhue
According to the RFCs, Content-Type is a header field, text is a media type, plain is a subtype, and you have 1 parameter- an attribute called charset with a value of utf-8.
Posted: Thu Nov 23, 2006 2:54 pm
by Chris Corbyn
Yes Goddammit.... of coursse it's an attribute. Obviously not had my weetabix today
Thanks guys.