Added provision for non-UTF-8 source