Formfields.SetTextInputValue umlauts "First Capital" and "Title case" lower case

If you put umlauts like “äöü” into a formfield with the formatting “First Capital” or “Title case” the result will still be a lower case character.

The following lines of code are leading to a wrong result.

void func(const SharedPtr<FormField>& field) {
System::String value{u"öffentliche änderung übersetzen"};

switch (field->get_TextInputType()) { 
  case TextFormFieldType::Regular: 
    field->SetTextInputValue(ObjectExt::Box<String>(value));
...
}}

Result should have been the following:
For “First Capital”
In: “öffentliche änderung übersetzen”
Should Result: “Öffentliche änderung übersetzen”
Actual result: “öffentliche änderung übersetzen”
For “Title case”
In: “öffentliche änderung übersetzen”
Should Result: “Öffentliche Änderung Übersetzen”
Actual result: “öffentliche änderung übersetzen”

Tested with aspose version: 23.9.0

@lefev Unfortunately, I cannot reproduce the problem on my side using the following simple code and the attached input document:

auto str = u"öffentliche änderung übersetzen";
System::SharedPtr<Document> doc = System::MakeObject<Document>(u"C:\\Temp\\in.docx");
for (int i = 0; i < doc->get_Range()->get_FormFields()->get_Count(); i++)
{
    System::SharedPtr<FormField> ff = doc->get_Range()->get_FormFields()->idx_get(i);
    ff->SetTextInputValue(System::ObjectExt::Box<String>(str));
}

doc->Save(u"C:\\Temp\\out.docx");

in.docx (12.8 KB)
out.docx (10.2 KB)

@alexey.noskov you are correct I have tried the same function with the newest version. It has been fixed with a version between 24.1.0 and 24.5.0.
Thank you very much.
My issue is solved.

1 Like