1) To handle non-ascii filenames which we set from table name. Fixes #2314 2) To handle non-ascii query data. Fixes #2253 3) To dump JSON type columns properly in csv. Fixes #2360