Coder Social home page Coder Social logo

Comments (4)

timbr0wn avatar timbr0wn commented on August 17, 2024

I'm not sure what's going on, but I guess clip.exe is using cp437, because pyperclip.ENCODING = 'cp-437' decodes properly.

However, the rest of my script assumes UTF-8, and my WSL2 terminal is using UTF-8 in general. I can't use cp-437 for everything anyway, since I need to handle a variety Unicode characters and that would just give endless encoding headaches.

Something has definitely changed, because everything was working perfectly up until a few weeks ago. I will keep investigating...

from pyperclip.

timbr0wn avatar timbr0wn commented on August 17, 2024

It seems like enabling "Beta: Use Unicode UTF-8 for worldwide language support" fixes my issue: https://superuser.com/a/1451686

Btw I'm on Windows 11 Pro. I'm really hoping that this option doesn't have any unintentional side effects 😬

My best guess for what I observed was that pyperclip was receiving text encoded with the OEM code page (as used in console applications; CP437 for en-us) instead of the ANSI code page (as used in GUI-subsystem applications; e.g., 1252 (Windows-1252).

from pyperclip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.