Repository: aws/aws-sdk-pandas

Issue:
UnicodeDecodeError when using athena.read_sql_query
### Describe the bug

Hi,
I am using the latest version of awswrangler library to extract bunch of tables from Athena. For one of my table function athena.read_sql_query fails with error:

`UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 230232: character maps to <undefined>`

Here is the part of code which is giving this error:
`df = wr.athena.read_sql_query(query, database=database, boto3_session=session, ctas_approach=False)`

Code otherwise works fine for other tables.

Here is the detailed error trace:
```

 File "D:\PythonProjects\venvPy392\lib\site-packages\awswrangler\athena\_read.py", line 897, in read_sql_query
    return _resolve_query_without_cache(
  File "D:\PythonProjects\venvPy392\lib\site-packages\awswrangler\athena\_read.py", line 519, in _resolve_query_without_cache
    return _resolve_query_without_cache_regular(
  File "D:\PythonProjects\venvPy392\lib\site-packages\awswrangler\athena\_read.py", line 425, in _resolve_query_without_cache_regular
    return _fetch_csv_result(
  File "D:\PythonProjects\venvPy392\lib\site-packages\awswrangler\athena\_read.py", line 161, in _fetch_csv_result
    ret = s3.read_csv(
  File "D:\PythonProjects\venvPy392\lib\site-packages\awswrangler\s3\_read_text.py", line 294, in read_csv
    return _read_text(
  File "D:\PythonProjects\venvPy392\lib\site-packages\awswrangler\s3\_read_text.py", line 149, in _read_text
    ret = _read_text_file(
  File "D:\PythonProjects\venvPy392\lib\site-packages\awswrangler\s3\_read_text.py", line 91, in _read_text_file
    df: pd.DataFrame = parser_func(f, **pandas_kwargs)
  File "D:\PythonProjects\venvPy392\lib\site-packages\pandas\io\parsers.py", line 610, in read_csv
    return _read(filepath_or_buffer, kwds)
  File "D:\PythonProjects\venvPy392\lib\site-packages\pandas\io\parsers.py", line 468, in _read
    return parser.read(nrows)
  File "D:\PythonProjects\venvPy392\lib\site-packages\pandas\io\parsers.py", line 1057, in read
    index, columns, col_dict = self._engine.read(nrows)
  File "D:\PythonProjects\venvPy392\lib\site-packages\pandas\io\parsers.py", line 2036, in read
    data = self._reader.read(nrows)
  File "pandas\_libs\parsers.pyx", line 756, in pandas._libs.parsers.TextReader.read
  File "pandas\_libs\parsers.pyx", line 771, in pandas._libs.parsers.TextReader._read_low_memory
  File "pandas\_libs\parsers.pyx", line 827, in pandas._libs.parsers.TextReader._read_rows
  File "pandas\_libs\parsers.pyx", line 814, in pandas._libs.parsers.TextReader._tokenize_rows
  File "pandas\_libs\parsers.pyx", line 1943, in pandas._libs.parsers.raise_parser_error
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 230232: character maps to <undefined>

```


### How to Reproduce

```
Create following view in Athena:

create view vw_error_test as 
select '“Noto Emoji”' as col

Query this view using awswrangler

query = 'select * from vw_error_test'
df = wr.athena.read_sql_query(query, database=database, boto3_session=session, ctas_approach=False)

```


### Expected behavior

_No response_

### Your project

_No response_

### Screenshots

_No response_

### Environment

```
Provide your `pip list` output, particularly the version of the AWS Data Wrangler library you used. Providing this information may significantly improve resolution times.
```


### OS

Windows

### Python version

3.9.2

### AWS DataWrangler version

2.14.0

### Additional context

_No response_


Discussion:
I am able to narrow down issue to a particular column in the Athena database table. 
Values in this column contain special characters like superscripts, and Asian characters. 

Since I am calling the function `athena.read_sql_query` with parameter` ctas_approach=False`, I have a feeling that the underlying function is not opening file with correct encoding.

Is it possible to pass encoding parameter to this function, which would then be used while reading the file (ex: `encoding='utf8'`) 
Hi @Chintan-D  - thanks for reaching out.  What is the data type of the column in Athena?
> Hi @Chintan-D - thanks for reaching out. What is the data type of the column in Athena?

varchar

![image](https://user-images.githubusercontent.com/10375096/153232822-09c47f3b-0ab2-46f6-be8a-038b77aa78a4.png)


```
CREATE OR REPLACE VIEW vw_error_test AS 
SELECT U&'\201CNoto Emoji\201D' col
```

Resolving patch:
diff --git a/awswrangler/s3/_read_text.py b/awswrangler/s3/_read_text.py
--- a/awswrangler/s3/_read_text.py
+++ b/awswrangler/s3/_read_text.py
@@ -28,7 +28,7 @@ def _get_read_details(path: str, pandas_kwargs: Dict[str, Any]) -> Tuple[str, Op
     if pandas_kwargs.get("compression", "infer") == "infer":
         pandas_kwargs["compression"] = infer_compression(path, compression="infer")
     mode: str = "r" if pandas_kwargs.get("compression") is None else "rb"
-    encoding: Optional[str] = pandas_kwargs.get("encoding", None)
+    encoding: Optional[str] = pandas_kwargs.get("encoding", "utf-8")
     newline: Optional[str] = pandas_kwargs.get("lineterminator", None)
     return mode, encoding, newline
 
diff --git a/awswrangler/s3/_write_text.py b/awswrangler/s3/_write_text.py
--- a/awswrangler/s3/_write_text.py
+++ b/awswrangler/s3/_write_text.py
@@ -24,7 +24,7 @@ def _get_write_details(path: str, pandas_kwargs: Dict[str, Any]) -> Tuple[str, O
     if pandas_kwargs.get("compression", "infer") == "infer":
         pandas_kwargs["compression"] = infer_compression(path, compression="infer")
     mode: str = "w" if pandas_kwargs.get("compression") is None else "wb"
-    encoding: Optional[str] = pandas_kwargs.get("encoding", None)
+    encoding: Optional[str] = pandas_kwargs.get("encoding", "utf-8")
     newline: Optional[str] = pandas_kwargs.get("lineterminator", "")
     return mode, encoding, newline
 


Test patch: