|  | @@ -9,6 +9,13 @@ class HTML {
 | 
	
		
			
				|  |  |  	 */
 | 
	
		
			
				|  |  |  	public static $macros = array();
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +	/**
 | 
	
		
			
				|  |  | +	 * Cache application encoding locally to save expensive calls to config::get().
 | 
	
		
			
				|  |  | +	 *
 | 
	
		
			
				|  |  | +	 * @var string
 | 
	
		
			
				|  |  | +	 */
 | 
	
		
			
				|  |  | +	public static $encoding = null;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  	/**
 | 
	
		
			
				|  |  |  	 * Registers a custom macro.
 | 
	
		
			
				|  |  |  	 *
 | 
	
	
		
			
				|  | @@ -31,7 +38,8 @@ class HTML {
 | 
	
		
			
				|  |  |  	 */
 | 
	
		
			
				|  |  |  	public static function entities($value)
 | 
	
		
			
				|  |  |  	{
 | 
	
		
			
				|  |  | -		return htmlentities($value, ENT_QUOTES, Config::get('application.encoding'), false);
 | 
	
		
			
				|  |  | +		if(static::$encoding===null) static::$encoding = Config::get('application.encoding');
 | 
	
		
			
				|  |  | +		return htmlentities($value, ENT_QUOTES, static::$encoding, false);
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	/**
 | 
	
	
		
			
				|  | @@ -42,7 +50,8 @@ class HTML {
 | 
	
		
			
				|  |  |  	 */
 | 
	
		
			
				|  |  |  	public static function decode($value)
 | 
	
		
			
				|  |  |  	{
 | 
	
		
			
				|  |  | -		return html_entity_decode($value, ENT_QUOTES, Config::get('application.encoding'));
 | 
	
		
			
				|  |  | +		if(static::$encoding===null) static::$encoding = Config::get('application.encoding');
 | 
	
		
			
				|  |  | +		return html_entity_decode($value, ENT_QUOTES, static::$encoding);
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	/**
 | 
	
	
		
			
				|  | @@ -55,7 +64,8 @@ class HTML {
 | 
	
		
			
				|  |  |  	 */
 | 
	
		
			
				|  |  |  	public static function specialchars($value)
 | 
	
		
			
				|  |  |  	{
 | 
	
		
			
				|  |  | -		return htmlspecialchars($value, ENT_QUOTES, Config::get('application.encoding'), false);
 | 
	
		
			
				|  |  | +		if(static::$encoding===null) static::$encoding = Config::get('application.encoding');
 | 
	
		
			
				|  |  | +		return htmlspecialchars($value, ENT_QUOTES, static::$encoding, false);
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	/**
 |