Fixed determination of encoding from system in KitDLL