≡

wincent.dev

  • Products
  • Blog
  • Wiki
  • Issues
You are viewing an historical archive of past issues. Please report new issues to the appropriate project issue tracker on GitHub.
Home » Issues » Bug #2119

Bug #2119: Clipper doesn't copy UTF-8 correctly

Kind bug
Product Clipper
When Created 2013-11-01T22:04:08Z, updated 2013-11-03T03:35:52Z
Status closed
Reporter anonymous
Tags no tags

Description

Clipper doesn't copy UTF-8 text correctly. For instance, I have a file foo with ¦æäëç, and run nc localhost 8377 < foo. Upon pasting (into either iTerm2 or TextEdit), the output is ¬¶√¶√§√´√ß (plus newline).

Comments

  1. Greg Hurrell 2013-11-03T02:12:11Z

    Thanks for the report. Looks like this only happens when run as a Launch Agent. I suspect the cause is no LANG environment variable being set, causing pbcopy to revert to default C encoding (see the pbcopy man page).

    We might be able to get around this by tweaking the launchd plist file to set an appropriate LANG setting.

  2. Greg Hurrell 2013-11-03T02:25:27Z

    Yep, looks like you can get it to work by modifying the plist, adding a section like:

    diff --git a/com.wincent.clipper.plist b/com.wincent.clipper.plist
    index d37bb09..921eb1d 100644
    --- a/com.wincent.clipper.plist
    +++ b/com.wincent.clipper.plist
    @@ -12,6 +12,11 @@
                    <string>--port</string>
                    <string>8377</string>
            </array>
    +       <key>EnvironmentVariables</key>
    +       <dict>
    +               <key>LANG</key>
    +               <string>en_US.UTF-8</string>
    +       </dict>
            <key>KeepAlive</key>
            <true/>
            <key>LimitLoadToSessionType</key>

    Where this file is depends on how you installed. If you installed using Homebrew, it's at /usr/local/Cellar/clipper/0.1/homebrew.mxcl.clipper.plist and you'll be able to fix things by stopping Clipper:

    $ launchctl unload /usr/local/Cellar/clipper/0.1/homebrew.mxcl.clipper.plist

    Editing the property list:

    $ vim /usr/local/Cellar/clipper/0.1/homebrew.mxcl.clipper.plist

    And restarting Clipper:

    $ launchctl load -w -S Aqua /usr/local/Cellar/clipper/0.1/homebrew.mxcl.clipper.plist

    If you installed it yourself, the steps are much the same but the property list most likely is at ~/Library/LaunchAgents/com.wincent.clipper.plist.

    UTF-8 seems like a reasonable default — and it's what the pbcopy man page recommends — so I'll push an update to the Clipper repo that includes this in the sample plist file, and probably also a pull request to update the Homebrew recipe as well.

  3. Greg Hurrell 2013-11-03T03:35:48Z

    0.2 is released, and here is the matching Homebrew pull request.

  4. Greg Hurrell 2013-11-03T03:35:52Z

    Status changed:

    • From: new
    • To: closed
Add a comment

Comments are now closed for this issue.

  • contact
  • legal

Menu

  • Blog
  • Wiki
  • Issues
  • Snippets