Anyone know what this is called?

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Anyone know what this is called?

Post 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.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: Anyone know what this is called?

Post 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 :P

Cheers :)
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

the charset= part reminds me of an Attribute...
brendandonhue
Forum Commoner
Posts: 71
Joined: Mon Sep 25, 2006 3:21 pm

Post 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.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Yes Goddammit.... of coursse it's an attribute. Obviously not had my weetabix today :)

Thanks guys.
Post Reply