Fix foreign characters (e.g.Umlaut) in JSON parser

Thanks to Walter Burki.

Fixes #529.