Attached is the patch to fix encoding issues while saving data in encoded charset other than 'utf-8'.
FYI : While using the local charset latin-9 (ISO 8859-15), if a record contains an umlaut ü and dataset was updated, then there was error message 'utf-8' codec can't decode byte 0xfc in positon 761: invalid start byte', which is fixed in this patch.