From time to time, I get the error Could not save due to an error. Malformed input: on text which does not appear to be malformed.
I found a way I can reliably reproduce it (Vivaldi/Linux):
- Load https://www.duden.de/rechtschreibung/Gendersternchen
- Triple-click the [ˈdʒɛndɐʃtɛrnçən] text in the "Aussprache" section
- Ctrl-C to copy
- Load https://test.wikidata.org/wiki/Q4605
- Start adding a new statement
- Select a string property, e.g. P664
- Ctrl-V to paste in the value field
- Press enter to save
Expected result: The statement is saved
Actual result: The error "Could not save due to an error. Malformed input: [ˈdʒɛndɐʃtɛrnçən]" is shown
If you make any changes to the text and undo them, then the value will suddenly be accepted, even though the text should be identical to the original value it tried to save, e.g. the following key sequences:
- backspace ]
- backspace ctrl-z
- space backspace
- . backspace
- home delete [
Pressing keys which don't change the text content does not help, e.g. arrow keys, ctrl, shift, alt, tab shift-tab
I tried in Firefox as well. There, the text is copied with extra spaces (which have to be manually removed before it will be accepted), but if I copy the text in Vivaldi (or Iridium, another Chromium-based browser) and paste it into the field in Firefox, I get the same problem.
If I paste the text into a textarea (e.g. talk page) there is a new line at the end of what is pasted. It seems like the new line is being stripped when pasting, but it thinks it is still there until I make a change to the field which makes it realise it isn't.
(this does not seem to be the same as T250695 since that is about improving the error when there are actual space characters in the string which the user should remove - in cases like this one, the text in the field is already correct)