Invalid UTF cannot be pasted, because it is silently discarded, without a notification, or option to remove it.

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

  • Close this issue

How To Reproduce It

  1. Enter an invalid codepoint into a file. I achieved this via normal usage:

    1. #!/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"
    2. Select “File”.

    3. Select “Save Output As…”

    4. Select “HTML” in the resultant QFileDialog's QComboBox.

    5. Enter an ASCII filename.

    6. Select “Save”.

  2. Invoke the generated file in code-1.108.2-1769004860.el8.x86_64. 1

  3. Select .*.

  4. #!/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

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

GitLab

18.9.0-pre 2a4948d27fc

My Environment

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 typebug

@gitlab-bot label reproduced on GitLab.com

  1. stackoverflow.com/questions/29465612/how-to-detect-invalid-utf8-unicode-binary-in-a-text-file#comment140964373_41741313 ↩

Edited Feb 10, 2026 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading