Invalid UTF cannot be pasted, because it is silently discarded, without a notification, or option to remove it.
<!--IssueSummary start-->
<details>
<summary>
Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards.
</summary>
- [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=588345)
</details>
<!--IssueSummary end-->
#### How To Reproduce It
1. Enter an invalid codepoint into a file. I achieved this via normal usage:
1. ~~~sh
#!/usr/bin/env pwsh
run0 dnf5 install --refresh -y konsole-25.12.1-1.fc43.x86_64 && `
konsole --hold -e coredumpctl debug `
--debugger=gdb `
--debugger-arguments="<#-ex 'set pagination off'#> -ex 'thread apply all bt full' -ex quit"
~~~
1. Select “File”.
1. Select “Save Output As…”
1. Select “HTML” in the resultant `QFileDialog`'s `QComboBox`.
1. Enter an ASCII filename.
1. Select “Save”.
1. Invoke the generated file in `code-1.108.2-1769004860.el8.x86_64`. [^1]
[^1]: [`stackoverflow.com/questions/29465612/how-to-detect-invalid-utf8-unicode-binary-in-a-text-file#comment140964373_41741313`](https://stackoverflow.com/questions/29465612/how-to-detect-invalid-utf8-unicode-binary-in-a-text-file#comment140964373_41741313:~:text=For%20me%2C%20even%20LC_ALL=en_US%2EUTF%2D8%20grep%20%2Daxv%20%27%2E*%27%20%22$HOME/%2Ehtml%22%20doesn%27t%20work%20for%20the%20content%20that%20gitlab%2Ecom/gitlab%2Dorg/gitlab/%2D/issues/588345%20describes%2E)
1. Select `.*`.
1. ~~~sh
#!/usr/bin/env pwsh
wl-paste --primary | wl-copy && `
firefox 'https://gitlab.com/-/snippets/new#source-editor-blob_local_47:~:text=rich%20text%20editing-,Files,-Delete%20file' && \
wl-paste --type text/plain
~~~
#### An Example Project
[`gitlab.com/-/snippets/4930079`](https://gitlab.com/-/snippets/4930079)
#### The Actual, Erroneous Behaviour
I am unable to paste anything past an invalid codepoint, but am not informed, upon submission, that my pasted content has been truncated at that point.
#### The Expected Behaviour
Instead, I should be able to paste all selected content, then informed whether I want to remove unsubmittable data, upon submission.
#### Demonstrative Logs And Media
{width=900 height=507}
#### GitLab
> `18.9.0-pre` `2a4948d27fc`
#### My Environment
~~~yaml
Name : firefox
Version : 147.0.1
Release : 5.fc43
Architecture: x86_64
Install Date: Thu 29 Jan 2026 00:03:08 GMT
Size : 270811677
Signature :
RSA/SHA256, Tue 27 Jan 2026 19:09:41 GMT, Key ID 829b606631645531
Source RPM : firefox-147.0.1-5.fc43.src.rpm
Build Date : Tue 27 Jan 2026 10:25:44 GMT
Build Host : buildhw-x86-03.rdu3.fedoraproject.org
Packager : Fedora Project
Vendor : Fedora Project
~~~
#### Organisation
@gitlab-bot label ~"type::bug"
@gitlab-bot label ~"reproduced on GitLab.com"
issue