fix some issues with characters encoding