Fix #23 encoding sql code when raising syntax error Exception