// get the corresponding utf8-value
if ((values[start] & 0xc0) != 0xc0) {
// should not happen, utf8 encoding starts at least with 11xxxxxx
- start++;
- continue;
+ // but value for '\dot{i}' is 'i', which is ascii
+ if ((values[start] & 0x80) == 0) {
+ // is ascii
+ accents[key] = values.substr(start, 1);
+ }
+ start++;
+ continue;
}
for (int j = 1; ;j++) {
if (start + j >= values.size()) {
start = values.size() - 1;
break;
}
- else if ((values[start+j] & 0xc0) == 0xc0) {
+ else if ((values[start+j] & 0xc0) != 0x80) {
// This is the first byte of following utf8 char
accents[key] = values.substr(start, j);
start += j;
accents["i"] = "ı";
accents["jmath"] = "ȷ";
accents["lyxmathsym{ß}"] = "ß";
+ accents["text{ß}"] = "ß";
accents["ddot{\\imath}"] = "ï";
- buildaccent("ddot", "aAeEiIoOuUyY",
- "äÃ\84ëÃ\8bïÃ\8föÃ\96üÃ\9cÿŸ"); // umlaut
- buildaccent("dot|.", "cCeEgGiIzZaAoObBdDfFyY",
- "Ä\8bÄ\8aÄ\97Ä\96Ä¡Ä iİżŻȧȦȯȮá¸\83á¸\82á¸\8bá¸\8aá¸\9fá¸\9eáº\8fáº\8e");
+ buildaccent("ddot", "aAeEiIioOuUyY",
+ "äÃ\84ëÃ\8bïÃ\8fïöÃ\96üÃ\9cÿŸ"); // umlaut
+ buildaccent("dot|.", "cCeEGgIizZaAoObBdDfFyY",
+ "Ä\8bÄ\8aÄ\97Ä\96Ä Ä¡Ä°Ä°Å¼Å»È§È¦È¯È®á¸\83á¸\82á¸\8bá¸\8aá¸\9fá¸\9eáº\8fáº\8e"); // dot{i} can only happen if ignoring case, but there is no lowercase of 'Ä°'
accents["acute{\\imath}"] = "í";
buildaccent("acute", "aAcCeElLoOnNrRsSuUyYzZiI",
"áÁćĆéÉĺĹóÓńŃŕŔśŚúÚýÝźŹíÍ");
buildaccent("dacute|H|h", "oOuU", "őŐűŰ"); // double acute
- buildaccent("mathring|r", "uU", "ůŮ");
+ buildaccent("mathring|r", "aAuUwy",
+ "åÅůŮẘẙ"); // ring
accents["check{\\imath}"] = "ǐ";
accents["check{\\jmath}"] = "ǰ";
- buildaccent("check|v", "cCdDaAeEiIoOuUgGkKhHlLnNrRsSTzZ",
- "Ä\8dÄ\8cÄ\8fÄ\8eÇ\8eÇ\8dÄ\9bÄ\9aÇ\90Ç\8fÇ\92Ç\91Ç\94Ç\93ǧǦǩǨÈ\9fÈ\9eľĽÅ\88Å\87Å\99Å\98šŠŤžŽ"); // caron
+ buildaccent("check|v", "cCdDaAeEiIoOuUgGkKhHlLnNrRsSTtzZ",
+ "Ä\8dÄ\8cÄ\8fÄ\8eÇ\8eÇ\8dÄ\9bÄ\9aÇ\90Ç\8fÇ\92Ç\91Ç\94Ç\93ǧǦǩǨÈ\9fÈ\9eľĽÅ\88Å\87Å\99Å\98šŠŤťžŽ"); // caron
accents["hat{\\imath}"] = "î";
accents["hat{\\jmath}"] = "ĵ";
buildaccent("hat|^", "aAeEiIcCgGhHjJsSwWyYzZoOuU",
"ăĂĕĔğĞĭĬŏŎŭŬ"); // breve
accents["grave{\\imath}"] = "ì";
buildaccent("grave|`", "aAeEiIoOuUnNwWyY",
- "àÀèÈìÌòÒùÙǹǸẁẀỳỲ"); // grave
+ "àÀèÈìÌòÒùÙǹǸẁẀỳỲ"); // grave
+ buildaccent("subdot|d", "BbDdHhKkLlMmNnRrSsTtVvWwZzAaEeIiOoUuYy",
+ "ḄḅḌḍḤḥḲḳḶḷṂṃṆṇṚṛṢṣṬṭṾṿẈẉẒẓẠạẸẹỊịỌọỤụỴỵ"); // dot below
}
/*
{
if (accents.empty())
buildAccentsMap();
- static regex const accre("\\\\((.|grave|breve|u|lyxmathsym|ddot|dot|acute|dacute|mathring|check|hat|bar|tilde)\\{[^\\{\\}]+\\}|i|imath|jmath)");
+ static regex const accre("\\\\((.|grave|breve|lyxmathsym|text|ddot|dot|acute|dacute|mathring|check|hat|bar|tilde|subdot)\\{[^\\{\\}]+\\}|(i|imath|jmath)(?![a-zA-Z]))");
smatch sub;
for (sregex_iterator itacc(par.begin(), par.end(), accre), end; itacc != end; ++itacc) {
sub = *itacc;
}
addIntervall(pos+val.size(), pos + sub.str(0).size());
for (size_t i = pos+val.size(); i < pos + sub.str(0).size(); i++) {
- // remove any remaining parentheses
+ // remove traces of any remaining chars
par[i] = ' ';
}
}