BUG: Enforce correct encoding in stata
State: closed

Ensure StataReader and StataWriter have the correct encoding.
Standardized default encoding to 'latin-1'

closes #15723

 - [x] closes #15723
 - [x] tests added / passed
 - [x] passes ``git diff upstream/master | flake8 --diff``
 - [x] whatsnew entry


Labels:
name: Unicode
description: Unicode strings
name: Error Reporting
description: Incorrect or improved errors from pandas
name: IO Stata
description: read_stata, to_stata

Comments:
@bashtage side issue. We finally have 32-bit daily wheels.

https://travis-ci.org/MacPython/pandas-wheels/jobs/213101390

so this one came up in testing (I am working fixing the rest). Unfort no easy way to test this as has to be on master. But if you have a fix can merge.

```
/venv/local/lib/python2.7/site-packages/pandas/tests/io/test_stata.py:247: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/venv/local/lib/python2.7/site-packages/pandas/tests/io/test_stata.py:88: in read_dta
    return read_stata(file, convert_dates=True)
/venv/local/lib/python2.7/site-packages/pandas/io/stata.py:173: in read_stata
    data = reader.read()
/venv/local/lib/python2.7/site-packages/pandas/io/stata.py:1526: in read
    data = self._insert_strls(data)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <pandas.io.stata.StataReader object at 0xede213ec>
data =       x    y            z
0   1.0  abc   4294967299
1   3.0  cba   8589934595
2  93.0       12884901891
    def _insert_strls(self, data):
        if not hasattr(self, 'GSO') or len(self.GSO) == 0:
            return data
        for i, typ in enumerate(self.typlist):
            if typ != 'Q':
                continue
>           data.iloc[:, i] = [self.GSO[k] for k in data.iloc[:, i]]
E           KeyError: 4294967299
/venv/local/lib/python2.7/site-packages/pandas/io/stata.py:1626: KeyError
```
@jreback I rolled a fix for the 32bit issue into this PR.  I can separate if you prefer.
@bashtage totally fine here. thanks! ping on green.
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/15768?src=pr&el=h1) Report
> Merging [#15768](https://codecov.io/gh/pandas-dev/pandas/pull/15768?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/163d18ed0d46eeb375f8170f1044808ff40b2a65?src=pr&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `90.9%`.


```diff
@@            Coverage Diff             @@
##           master   #15768      +/-   ##
==========================================
- Coverage   91.01%   90.99%   -0.02%     
==========================================
  Files         143      143              
  Lines       49377    49384       +7     
==========================================
- Hits        44941    44938       -3     
- Misses       4436     4446      +10
```


| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/15768?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/stata.py](https://codecov.io/gh/pandas-dev/pandas/compare/163d18ed0d46eeb375f8170f1044808ff40b2a65...8278be7dc466229f92f938e38514b9225a65b1f9?src=pr&el=tree#diff-cGFuZGFzL2lvL3N0YXRhLnB5) | `93.47% <90.9%> (-0.05%)` | :arrow_down: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/compare/163d18ed0d46eeb375f8170f1044808ff40b2a65...8278be7dc466229f92f938e38514b9225a65b1f9?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/compare/163d18ed0d46eeb375f8170f1044808ff40b2a65...8278be7dc466229f92f938e38514b9225a65b1f9?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.86% <0%> (-0.1%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/15768?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/15768?src=pr&el=footer). Last update [163d18e...8278be7](https://codecov.io/gh/pandas-dev/pandas/compare/163d18ed0d46eeb375f8170f1044808ff40b2a65...8278be7dc466229f92f938e38514b9225a65b1f9?el=footer&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
thanks! always a pleasure @bashtage 
@bashtage looks like this fixed the 32-bit error as well! https://travis-ci.org/MacPython/pandas-wheels/jobs/213622884

thanks (of course other errors which I am working on ......)