Fix #345, consistent encoding declaration