Encoding support (fix #4).