Changed way to get charset from response

Obtaining charset through getattr instead of accessing it directly

Signed-off-by: Carlos Oliveira <carlospecter@gmail.com>
Signed-off-by: Alexandre Almeida <alexandreab@live.com>