remove encoding definition before pass it back
fix preg_quote