diff --git a/src/libespeak-ng/compiledict.c b/src/libespeak-ng/compiledict.c index 108be5b3..d84d42cd 100644 --- a/src/libespeak-ng/compiledict.c +++ b/src/libespeak-ng/compiledict.c @@ -591,7 +591,7 @@ static int compile_line(char *linebuf, char *dict_line, int n_dict_line, int *ha if (c2 == 0) break; if (iswupper(c2)) - utf8_out(towlower2(c2), p); + utf8_out(towlower2(c2, translator), p); else all_upper_case = false; p += ix; diff --git a/src/libespeak-ng/numbers.c b/src/libespeak-ng/numbers.c index f3d1cd3c..e4219bd9 100644 --- a/src/libespeak-ng/numbers.c +++ b/src/libespeak-ng/numbers.c @@ -709,7 +709,7 @@ int TranslateLetter(Translator *tr, char *word, char *phonemes, int control, ALP if (iswupper(letter)) Lookup(tr, "_cap", capital); } - letter = towlower2(letter); + letter = towlower2(letter, tr); LookupLetter(tr, letter, word[n_bytes], ph_buf, control & 1); if (ph_buf[0] == 0) { diff --git a/src/libespeak-ng/readclause.c b/src/libespeak-ng/readclause.c index 193a64f2..a9cafb58 100644 --- a/src/libespeak-ng/readclause.c +++ b/src/libespeak-ng/readclause.c @@ -132,7 +132,7 @@ int clause_type_from_codepoint(uint32_t c) return CLAUSE_NONE; } -int towlower2(unsigned int c) +int towlower2(unsigned int c, Translator *translator) { // check for non-standard upper to lower case conversions if (c == 'I' && translator->langopts.dotless_i) diff --git a/src/libespeak-ng/readclause.h b/src/libespeak-ng/readclause.h index ca8789dc..a49da28f 100644 --- a/src/libespeak-ng/readclause.h +++ b/src/libespeak-ng/readclause.h @@ -35,7 +35,7 @@ typedef struct { extern PARAM_STACK param_stack[]; int clause_type_from_codepoint(uint32_t c); -int towlower2(unsigned int c); // Supports Turkish I +int towlower2(unsigned int c, Translator *translator); // Supports Turkish I int Eof(void); const char *WordToString2(unsigned int word); int Read4Bytes(FILE *f); diff --git a/src/libespeak-ng/translate.c b/src/libespeak-ng/translate.c index db36d015..038041fe 100644 --- a/src/libespeak-ng/translate.c +++ b/src/libespeak-ng/translate.c @@ -1816,7 +1816,7 @@ static int SubstituteChar(Translator *tr, unsigned int c, unsigned int next_in, // there is a list of character codes to be substituted with alternative codes if (iswupper(c_lower = c)) { - c_lower = towlower2(c); + c_lower = towlower2(c, tr); upper_case = 1; } @@ -1827,7 +1827,7 @@ static int SubstituteChar(Translator *tr, unsigned int c, unsigned int next_in, new_c = replace_chars[ix+1]; break; } - if ((word >> 16) == (unsigned int)towlower2(next_in)) { + if ((word >> 16) == (unsigned int)towlower2(next_in, tr)) { new_c = replace_chars[ix+1]; ignore_next = true; break; @@ -2146,7 +2146,7 @@ void TranslateClause(Translator *tr, int *tone_out, char **voice_change) if ((option_sayas2 == SAYAS_KEY) && (c != ' ')) { if ((prev_in == ' ') && (next_in == ' ')) option_sayas2 = SAYAS_SINGLE_CHARS; // single character, speak its name - c = towlower2(c); + c = towlower2(c, tr); } @@ -2284,7 +2284,7 @@ void TranslateClause(Translator *tr, int *tone_out, char **voice_change) } if (iswupper(c)) { - c = towlower2(c); + c = towlower2(c, tr); if ((j = tr->langopts.param[LOPT_CAPS_IN_WORD]) > 0) { if ((j == 2) && (syllable_marked == false)) { @@ -2297,7 +2297,7 @@ void TranslateClause(Translator *tr, int *tone_out, char **voice_change) // lower case followed by upper case in a word if (UpperCaseInWord(tr, &sbuf[ix], c) == 1) { // convert to lower case and continue - c = towlower2(c); + c = towlower2(c, tr); } else { c = ' '; // lower case followed by upper case, treat as new word space_inserted = true;