Hello.
Your zkanji program is very user friendly.
But I am having trouble using the import function.
And more specifically:
1) I exported the Russian dictionary to the file "rus.zkanji.export"
(see Clipboard01.jpg)
2) imported it into a new dictionary and got errors:
(see Clipboard02.jpg)
Saving dictionary data.
Starting full dictionary import...
Target dictionary: rr_enn
Adding temporary dictionary for reading.
Opening export file...
Reading export file...
Found section: words
Error on line 1377: [bad format] corrupt definition data
Error on line 8342: [bad format] corrupt definition data
Error on line 10023: [bad format] corrupt definition data
Error on line 10024: [bad format] corrupt definition data
Error on line 10428: [bad format] corrupt definition data
Error on line 22042: [bad format] corrupt definition data
Error on line 23404: [bad format] corrupt definition data
Error on line 26230: [bad format] corrupt definition data
Error on line 38178: [bad format] corrupt definition data
Error on line 49956: [bad format] corrupt definition data
Error on line 60380: [bad format] corrupt definition data
Error on line 60725: [bad format] corrupt definition data
Error on line 61243: [bad format] corrupt definition data
Error on line 61244: [bad format] corrupt definition data
Error on line 61290: [bad format] corrupt definition data
Error on line 61762: [bad format] corrupt definition data
Error on line 61763: [bad format] corrupt definition data
Error on line 61836: [bad format] corrupt definition data
Error on line 61837: [bad format] corrupt definition data
Error on line 61843: [bad format] corrupt definition data
Error on line 61844: [bad format] corrupt definition data
Error on line 61881: [bad format] corrupt definition data
Found section: kanji
Error on line 66282: [bad format] corrupt kanji line
Error on line 66365: [bad format] corrupt kanji line
Expanding dictionary with imported words. This can take a while...
Passed words: 5000
Passed words: 10000
Passed words: 15000
Passed words: 20000
Passed words: 25000
Passed words: 30000
Passed words: 35000
Passed words: 40000
Passed words: 45000
Passed words: 50000
Passed words: 55000
Passed words: 60000
Successfully imported:
Words: 63344
Meanings: 100095
Importing kanji definitions...
6277 kanji definitions imported.
Initializing dictionary update...
Looking up words in the original dictionary...
Select action to take for changed words with conflict in groups...
Updating dictionary...
Dictionary update completed...
Saving dictionary data.
Import completed.
3) as a result, the symbols are displayed incorrectly in the new dictionary. (see Clipboard03.jpg)
Solution for fix import error:
1) I found an inaccuracy in the code regarding the import of the dictionary:
// fix import error - utf8 2 byte cinvert symbols
// [bad format] corrupt definition data
// [bad format] corrupt kanji line
1) open zkformats.cpp
2) replace 321 line
wc = ((c [0] & 0xF) << 6) | (c [1] & 0x3F);
to
wc = ((c [0] & 0x1F) << 6) | (c [1] & 0x3F);
2) There is also a bug with importing a dictionary, in the meaning field if there is a space in the line first.
My example of fixing this problem:
// a message appears: [bad format] corrupt definition data
open import.cpp
replace starting at line 2042
if (token [pos + 1] == 0)
{
error = true;
marker = NULL;
return NULL;
}
int tlen = wcslen (token);
marker = token;
to
int tlen = wcslen (token);
marker = token;
if (token [pos + 1] == 0)
{
// error = true;
// marker = NULL;
// return NULL;
NextToken (searchdata, L '\ t');
if (searchdata.separator! = L '\ t' || (* searchdata.next! = L '' && * searchdata.next! = 0)) // End of string before tab character was found or tab was in the middle of a string.
{
error = true;
marker = NULL;
return NULL;
}
}
else
3) fix kanji impot bug.
open collection.cpp
replace 2919 line
wcscpy(Items[ix]->kanjidat[kindex].meaning, meaning.c_str());
to
wcscpy(Items[ix]->kanjidat[kindex].meaning, meaning.w_str());
Anonymous