let cm = CaseMapper::new();
let nl = langid!("nl");
let mut options = TitlecaseOptions::default();
options.trailing_case = Some(TrailingCase::Lower);
assert_eq!(
cm.titlecase_segment_with_only_case_data_to_string("ij", &nl, default_options),
"IJ"
);
Instead if IJ, we get Ij. This is because the way we implement TrailingCase::Unchanged is that we switch over to lowercasing once we process the first character:
|
if IS_TITLE_CONTEXT { |
|
if self.titlecase_tail_casing == TrailingCase::Lower { |
|
mapping = MappingKind::Lower; |
|
} else { |
AIUI, Dutch is the only tailoring that ever cares about more than the first character when titlecasing; so we mostly just need to ensure the trailing case handling can check for this case.
Instead if
IJ, we getIj. This is because the way we implementTrailingCase::Unchangedis that we switch over to lowercasing once we process the first character:icu4x/components/casemap/src/internals.rs
Lines 72 to 75 in 78c809c
AIUI, Dutch is the only tailoring that ever cares about more than the first character when titlecasing; so we mostly just need to ensure the trailing case handling can check for this case.