Skip to content

Trailing case adjustment doesn't handle Dutch #7861

@Manishearth

Description

@Manishearth
    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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions