added support for non-european character encodings