utf8clip 1.0.0

Copies text from the Windows clipboard to console output and from console input to the Windows clipboard using UTF-8 encoding. Works well with PowerShell Core or console programs that explicitly output UTF-8 text.

dotnet tool install --global utf8clip --version 1.0.0
This package contains a .NET Core Global Tool you can call from the shell/command line.

Replacement for clip.exe in Windows that supports both read from/write to clipboard and uses UTF-8 encoding by default.

Works well with PowerShell Core or console programs that explicitly output UTF-8 text.

Usage

If started with file/piped input:

  • Copies the input, interpreted as UTF-8 text†, to the Windows clipboard.

Otherwise:

  • Prints the contents of the Windows clipboard to output as UTF-8 text.

†If there is a byte-order mark in the input it will be respected, e.g. for UTF-16 encoded files.

Examples

Copy program output to clipboard

<program> | utf8clip

Places a copy of the UTF-8 output from <program> on to the Windows clipboard.

Note that most native Windows commands like dir do not write UTF-8 output unless the console codepage is changed with chcp.

Copy file content to clipboard

utf8clip < README.md

Places a copy of the text from README.md on to the Windows clipboard.

Write clipboard content to console

utf8clip

Writes the current contents of the Windows clipboard to the console.

PowerShell Core Examples

Copy program output to clipboard

ls | utf8clip

Places a copy of the current directory listing on to the Windows clipboard.

This works correctly as PowerShell Core uses UTF-8 output by default.

Copy file content to clipboard

cat .\README.md | utf8clip

Places a copy of the text from README.md on to the Windows clipboard.

Write clipboard content to console

utf8clip

Writes the current contents of the Windows clipboard to the console.

Replacement for clip.exe in Windows that supports both read from/write to clipboard and uses UTF-8 encoding by default.

Works well with PowerShell Core or console programs that explicitly output UTF-8 text.

Usage

If started with file/piped input:

  • Copies the input, interpreted as UTF-8 text†, to the Windows clipboard.

Otherwise:

  • Prints the contents of the Windows clipboard to output as UTF-8 text.

†If there is a byte-order mark in the input it will be respected, e.g. for UTF-16 encoded files.

Examples

Copy program output to clipboard

<program> | utf8clip

Places a copy of the UTF-8 output from <program> on to the Windows clipboard.

Note that most native Windows commands like dir do not write UTF-8 output unless the console codepage is changed with chcp.

Copy file content to clipboard

utf8clip < README.md

Places a copy of the text from README.md on to the Windows clipboard.

Write clipboard content to console

utf8clip

Writes the current contents of the Windows clipboard to the console.

PowerShell Core Examples

Copy program output to clipboard

ls | utf8clip

Places a copy of the current directory listing on to the Windows clipboard.

This works correctly as PowerShell Core uses UTF-8 output by default.

Copy file content to clipboard

cat .\README.md | utf8clip

Places a copy of the text from README.md on to the Windows clipboard.

Write clipboard content to console

utf8clip

Writes the current contents of the Windows clipboard to the console.

Dependencies

This package has no dependencies.

Version History

Version Downloads Last updated
1.0.0 44 10/2/2019