Vagabond/erlang-iconv — pull request #3 by nevar (2012-12-17 08:13:28+00:00)
Title: Fix convert

If we convert from one byte to many byte, then may happen next.

Example of convert from windows-1251 to utf-8:

iconv ask to realloc buffer. We alloc odd byte. Next call to iconv failed to
write 2 byte utf symbol and return last result. Convert ended without fully
converted string.

Also add test.

```bash
iconv -f utf-8 -t windows-1251
Шашков Дени
Øàøêîâ Äåíè
```
New version:
```erlang
4> iconv:start(), {ok, CD} = iconv:open("utf-8", "windows-1251"), V = <<"Øàøêîâ Äåíè">>, io:format("=~ts=~n", [element(2, iconv:conv(CD, V))]).
=Шашков Дени=
```

Old version:
```erlang
1> iconv:start(), {ok, CD} = iconv:open("utf-8", "windows-1251"), V = <<"Øàøêîâ Äåíè">>, io:format("=~ts=~n", [element(2, iconv:conv(CD, V))]).
=Шашков Де=
```