[PATCHv2 2/2] speakup: Support spelling unicode characters

Chris Brannon chris at the-brannons.com
Tue Mar 14 12:06:36 EDT 2017


Samuel Thibault <samuel.thibault at ens-lyon.org> writes:

> This supports spelling unicode characters by just passing them to
> the speech synthesis in direct mode.
>
> Signed-off-by: Samuel Thibault <samuel.thibault at ens-lyon.org>
>
> Index: linux-4.10/drivers/staging/speakup/main.c
> ===================================================================
> --- linux-4.10.orig/drivers/staging/speakup/main.c
> +++ linux-4.10/drivers/staging/speakup/main.c
> @@ -432,7 +432,7 @@ static void speak_char(u16 ch)
>  	char *cp;
>  	struct var_t *direct = spk_get_var(DIRECT);
>  
> -	if (direct && direct->u.n.value) {
> +	if (ch >= 0x100 || (direct && direct->u.n.value)) {
>  		if (IS_CHAR(ch, B_CAP)) {
>  			spk_pitch_shift++;
>  			synth_printf("%s", spk_str_caps_start);
> @@ -443,8 +443,6 @@ static void speak_char(u16 ch)
>  		return;
>  	}

This is going to misidentify some Unicode characters >= 0x100 as
capital.  You probably want to add ch < 0x100 tests to the if(is_char
...) conditions, like you did in spell_word.  Please resend with that
fix and you'll get my Reviewed-by line.

Regards,
-- Chris


More information about the Speakup mailing list