3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
10 namespace Zend\Http\Header
;
12 use Zend\Http\Header\Accept\FieldValuePart
;
15 * Accept Charset Header
17 * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.2
19 class AcceptCharset
extends AbstractAccept
21 protected $regexAddType = '#^([a-zA-Z0-9+-]+|\*)$#';
28 public function getFieldName()
30 return 'Accept-Charset';
38 public function toString()
40 return 'Accept-Charset: ' . $this->getFieldValue();
44 * Add a charset, with the given priority
47 * @param int|float $priority
50 public function addCharset($type, $priority = 1)
52 return $this->addType($type, $priority);
56 * Does the header have the requested charset?
61 public function hasCharset($type)
63 return $this->hasType($type);
67 * Parse the keys contained in the header line
69 * @param string $fieldValuePart
70 * @return \Zend\Http\Header\Accept\FieldValuePart\CharsetFieldValuePart
71 * @see \Zend\Http\Header\AbstractAccept::parseFieldValuePart()
73 protected function parseFieldValuePart($fieldValuePart)
75 $internalValues = parent
::parseFieldValuePart($fieldValuePart);
77 return new FieldValuePart\
CharsetFieldValuePart($internalValues);