Commit fbda5448 authored by Yann Boucher's avatar Yann Boucher
Browse files

Fixed an encoding issue with JSON files (don't use utf-8 characters for some...

Fixed an encoding issue with JSON files (don't use utf-8 characters for some reason it breaks QJsonDocument even though it ought to be working
parent be586086
Pipeline #78770 passed with stages
in 17 seconds
......@@ -14,8 +14,8 @@ public:
unsigned getState(unsigned cell, const Neighborhood& neighborhood) const override;
private:
DEFINE_CONFIGURABLE_PROPERTY(IntegerProperty, states, "Nombre d'états", 1);
DEFINE_CONFIGURABLE_PROPERTY(IntegerProperty, thresold, "Seuil");
DEFINE_CONFIGURABLE_PROPERTY(IntegerProperty, states, "State count", 1);
DEFINE_CONFIGURABLE_PROPERTY(IntegerProperty, thresold, "Threshold");
};
REGISTER_FACTORY_ENTRY(TransitionRule, CircularTransition, "Circular");
......
......@@ -10,8 +10,8 @@
"neighborhood_name": "Von Neumann",
"title": "test3",
"transition_data": {
"Nombre d'états": 4,
"Seuil": 3
"State count": 4,
"Threshold": 3
},
"transition_name": "Circular"
}
......@@ -89,7 +89,7 @@ void ModelLoadingDialog::update_info(QTreeWidgetItem *item, int column)
QTextStream in(&f);
QJsonParseError parseError;
QJsonDocument jsonDoc = QJsonDocument::fromJson(QByteArray::fromStdString(in.readAll().toStdString()), &parseError);
QJsonDocument jsonDoc = QJsonDocument::fromJson(in.readAll().toUtf8(), &parseError);
if(parseError.error != QJsonParseError::NoError)
{
throw ModelLoadingException("Erreur de parsing JSON à " + std::to_string(parseError.offset) + ":" + parseError.errorString().toStdString());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment