Skip to content

Set-Clipboard -AsHtml puts invalid CF_HTML on clipboard with non-ASCII text #3177

Closed

Description

@bcdev-com

Steps to reproduce

  1. Set-Clipboard -AsHtml "abc"
  2. Paste into Word
    3) Text appears correctly as: abc
  3. Set-Clipboard -AsHtml "àbc"
  4. Paste into Word
  5. Text appears incorrectly as: ࢣ
    Appears CP 1251 text is being put in the CF_HTML, not UTF8.

Expected behavior

Text containing non-ASCII characters should be corrected converted to CF_HTML

Actual behavior

Any characters outside the ASCII range corrupt the HTML placed on the clipboard.

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      5.1.14393.693
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.693
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Activity

  1. added
    WG-Cmdlets
    Issue-Bug
    on Feb 21, 2017
  2. added
    Resolution-Won't Fix
    on Mar 7, 2017
  3. SteveL-MSFT commented on Mar 8, 2017

    @SteveL-MSFT
    Member

    At this time the Clipboard cmdlets are not compatible with PSCore6 as it depends on a System.Windows.Forms class which isn't part of corefx and would not be cross platform compatible.

    I do think the clipboard cmdlets are useful, but should be a separate module that is cross platform compatible which may require different code paths per OS.

  4. pcgeek86 commented on Apr 21, 2017

    @pcgeek86

    Steve Lee (@SteveL-MSFT) Can you open up this ticket, unless there's already a stub somewhere for a future Clipboard PowerShell module?

  5. added
    Resolution-Won't Fix
    and removed
    Resolution-Won't Fix
    on Apr 21, 2017
  6. SteveL-MSFT commented on Apr 21, 2017

    @SteveL-MSFT
    Member

    Trevor Sullivan (@pcgeek86) I think you should open a new issue if you want a clipboard module as this one was for a specific issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugResolution-Won't FixWG-Cmdlets

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions