size_t uppercased_part_3_4_len;
uint8_t *uppercased_part_3_4 =
u8_ct_toupper (pointer3, pointer4 - pointer3,
u8_casing_prefix_context (s, pointer3 - s),
u8_casing_suffix_context (pointer4, s_end - pointer4),
iso639_language, NULL, NULL, &uppercased_part_3_4_len);
size_t uppercased_part_6_8_len;
uint8_t *uppercased_part_6_8 =
u8_ct_toupper (pointer6, pointer8 - pointer6,
u8_casing_prefix_context (s, pointer6 - s),
u8_casing_suffix_context (pointer8, s_end - pointer6),
iso639_language, NULL, NULL, &uppercased_part_6_8_len);
Regarding this part, how could I use the incremental context
computation? I can imagine how to use u8_casing_prefixes_context, but
not the same for suffixes:
forgot_the_type_name pre = u8_casing_prefix_context (s, pointer3 - s);
forgot_the_type_name suf = u8_casing_suffix_context (pointer4,
s_end - pointer4);
size_t uppercased_part_3_4_len;
uint8_t *uppercased_part_3_4 =
u8_ct_toupper (pointer3, pointer4 - pointer3, pre, suf,
iso639_language, NULL, NULL,
&uppercased_part_3_4_len);
pre = u8_casing_prefixes_context (pointer4, pointer6 - pointer4, pre);
suf = u8_casing_suffix_context (pointer8, s_end - pointer8, suf);
size_t uppercased_part_6_8_len;
uint8_t *uppercased_part_6_8 =
u8_ct_toupper (pointer6, pointer8 - pointer6, pre, suf,
iso639_language, NULL, NULL,
&uppercased_part_6_8_len);
Is this intentional? Does u8_casing_suffixes_context make sense only
when scanning backwards?
If so, you should add something like: "u8_casing_prefixes_context is
convenient if you are scanning a string forwards, while
u8_casing_suffixes_context does the same function when scanning
backwards. For the suffix context on forward scans you should just pass
the entire remaining part of the string u8_casing_suffix_context, and
likewise for the prefix context on backward scans."
(Note that in my case I have no control on the characters I ask you to
case-fold; it may be that I ask you to case-fold a combining accent and
only that).
> And finally use u8_normalize to normalize the result to NFC
> (optional, but recommended):
It would be nice to have something in coreutils doing normalization...
Paolo