ktekinay / Data-Serialization

Xojo class to serialize and deserialize classes via JSON
MIT License
12 stars 3 forks source link

Serializing a class that has an empty String value leads to exception #1

Open jkleroy opened 9 years ago

jkleroy commented 9 years ago

Hi,

I don't know yet if I'll be needing this class but it is impressive. Thanks for your great work. I found an issue when a String property has an empty value.

*Scenario: Add a String property to MyMinorClass. Let's name it "txt".

Run the project, click on the Serialize button.

Exception raised: ErrorNumber: 0 Message: root{?}{?}{?}{?}: String value is not convertible to UTF-8 Reason: root{?}{?}{?}{?}: String value is not convertible to UTF-8

*Workaround: Set a default value <> "" to all String properties.

*Remarks: An empty Text property doesn't have this issue.

ktekinay commented 9 years ago

Thanks.

This is a known bug in the Xojo framework. The workaround is to store an empty Text where an empty String is detected.