Fixed encoding for new buffer
Merge pull request #987 from Linuus/master

Fixed encoding issues