View Single Post
Old 10-23-2018, 10:09 AM   #26
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,849
Karma: 6120478
Join Date: Nov 2009
Device: many
Next I edited sigil_clips.ini and changed the 22nd entry to:

Code:
22\Name=Krishna
22\Text=K\x1e5b\x1e63\x1e47\x61
Then edited Sigil/src/MiscEditors/ClipEditorModel.cpp and added the call to set the ini codec to utf-8:

Code:
void ClipEditorModel::LoadData(const QString &filename, QStandardItem *item)
{
    SettingsStore *settings;

    if (filename.isEmpty()) {
	settings = new SettingsStore(m_SettingsPath);
    } else {
        settings = new SettingsStore(filename);
    }

    settings->setIniCodec("UTF-8");

    int size = settings->beginReadArray(SETTINGS_GROUP);
Then fired up Sigil and opened the Clips view window and selected Krishna and it properly pasted in:

Kṛṣṇa

And then I used the clips editor to create and save a new Krishna2 clip and exited out of Sigil and went and looked at the sigil_clips.ini file and saw the following:

Code:
22\Name=Krishna
22\Text=K\x1e5b\x1e63\x1e47\x61
23\Name=Krishna2
23\Text=K\x1e5b\x1e63\x1e47\x61
So setting the codec of the ini file to utf-8 was NOT enough to get it to save the ini file as a utf-8 encoded file.

So so all of this testing may be in vain. I will take a closer look at the code that loads data and saves data in these models to see if I can see what is going on.

KevinH
KevinH is offline   Reply With Quote