utf-8 conversion with mb_convert_encoding instead of bugged iconv
This commit is contained in:
		@@ -178,15 +178,6 @@ abstract class Formatter {
 | 
				
			|||||||
	 * @return string
 | 
						 * @return string
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	public static function utf8($text) {
 | 
						public static function utf8($text) {
 | 
				
			||||||
		if (!$text) {
 | 
							return mb_convert_encoding($text, 'UTF-8');
 | 
				
			||||||
			return $text;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		$value = @iconv('UTF-8', 'UTF-8//IGNORE', $text);
 | 
					 | 
				
			||||||
		if (!$value) {
 | 
					 | 
				
			||||||
			// Prevent bugged iconv() of some systems
 | 
					 | 
				
			||||||
			$text  = preg_replace('/[^[:print:]]/', '', $text);
 | 
					 | 
				
			||||||
			$value = iconv('UTF-8', 'UTF-8//IGNORE', $text);
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		return $value;
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user