Giter VIP home page Giter VIP logo

Comments (11)

insanum avatar insanum commented on July 17, 2024 1

@ihatelogin don't you just hate it when the developer isn't helpful? Sucks I know, but sometimes those developers are just way to busy and simple python scripts are never a priority.

There was a new "--locale" option added to gcalcli. That might help address this issue. If not it is encouraged you take some time to create a github pull request that contains a proper fix.

from gcalcli.

insanum avatar insanum commented on July 17, 2024

Did you try the latest code in the git master branch?

from gcalcli.

 avatar commented on July 17, 2024

Yes.
I've copied content of https://raw.github.com/insanum/gcalcli/master/gcalcli, but still have the same error.

Oh, just checked right now and from command line i've good response (good calendar) - only when i run gcalcli from conky script i have that issue.

from gcalcli.

 avatar commented on July 17, 2024

OK, so developer wasn't very helpful and I had to find workaround:

  1. git clone http://www.tablix.org/~avian/git/unidecode.git
  2. cd unidecode
  3. sudo python setup.py install
  4. sudo vi /usr/bin/gcalcli
  5. above “from Queue import Queue” add “from unidecode import unidecode”
  6. find “def PrintMsg(color, msg)”, and else statement should look like this "sys.stdout.write(unidecode(msg))"

All thanks goes to "Gilles Lenfant" (http://www.peterbe.com/plog/unicode-to-ascii#c358f0d)

from gcalcli.

BeniaminK avatar BeniaminK commented on July 17, 2024

Or in PrintMsg function, after every msg one should encode to utf-8, so msg.encode("utf-8") should work properly.

from gcalcli.

Unkuiri avatar Unkuiri commented on July 17, 2024

Following what is said here: http://stackoverflow.com/questions/8016236/python-unicode-handling-differences-between-print-and-sys-stdout-write
"A better solution might be to replace sys.stdout with a wrapper". This is accomplished by adding this:

class StdOut(object):
    def write(self, string):
        if isinstance(string, unicode):
            string = string.encode(sys.__stdout__.encoding)
        sys.__stdout__.write(string)

sys.stdout = StdOut()

to the part just next to the import part, for example on line 62 or 63 and on the def PrintMsg(color, msg) part the else statement should look like sys.stdout.write(msg)

Hope this helps

from gcalcli.

tresni avatar tresni commented on July 17, 2024

This is probably the same issue I talked about over here in #8 and is likely fixed with b713a8c . Right now I've tagged that as 2.5 milestone as I really need more people then just me to test it. I'm actually inclined to mark this as a duplicate.

from gcalcli.

insanum avatar insanum commented on July 17, 2024

Got an email that unicode in the month names break the calw and calm output. Don't know if @tresni fix fixes this problem.
screenshot

from gcalcli.

tresni avatar tresni commented on July 17, 2024

Probably not, though I think I know where the issue is. I believe the east_asian_width calls only apply to descriptions, not month/day names so that could definitely be an issue.

from gcalcli.

insanum avatar insanum commented on July 17, 2024

We should probably filter all terminal output through a single function that does the proper conversions. This unicode stuff has plagued gcalcli for quite some time now. Maybe unifying the output path will help. Thoughts?

from gcalcli.

tresni avatar tresni commented on July 17, 2024

Agree. I've found a couple other odd output errors. If I set my output width too big (variable depending on terminal window size) and have more one meeting in the day, I get newlines in the output where it shouldn't be...

2 bhartvigsen_baldeagle_ _ zsh

from gcalcli.

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.