Giter Site home page Giter Site logo

Comments (7)

ohare93 avatar ohare93 commented on June 9, 2024 2

You always have a vote, my friend 😁

from brain-brew.

AFulgens avatar AFulgens commented on June 9, 2024 2

I'll prepare a PR then.

On a side-note, I have noticed that there is also a problem with encoding, namely if I use Umlauts in fields name (ΓΌ comes to mind), then I will get a mixture of UTF-8 and cp1252 files. Is that also something Windows/Windows + Python related, i.e., on Linux non-ASCII should work fine? It's also something I could look into, but that sounds like a heavy change, because alls the reads/writes have to be fixed to UTF-8 instead of defaulting. Would that also be something interesting or should I just live with the fact that my fields should not contain high-ASCII/non-ASCII characters?

from brain-brew.

AFulgens avatar AFulgens commented on June 9, 2024 2

So far I have seen cp1252 only in YAML files generated with anki_to_sources recipes and problems with non-ASCII in sources_to_anki as well (i.e., mojibake in the resulting deck.json). I'll investigate and if it's not too many changes I will roll it together into a single PR with the regex fix.

from brain-brew.

aplaice avatar aplaice commented on June 9, 2024 1

I haven't looked at #43 in a while, so I'm not 100% sure, but I think the PR itself is independent of the issue here (it's about replacing the old codecs.open with just open).

The discussion in "Aside on newlines" probably is vaguely relevant (but again not 100% sure) β€” I believe that in order to allow Windows and Linux users to inter-operate peacefully (without a back-and-forth war between \n and \r\n ) we will need to add newline='' to the open call.

Maybe, though, let's just cross this once we encounter this in the wild? (i.e. if I had a vote, I'd vote for just applying anything that @AFulgens needs, for now. :))

from brain-brew.

ohare93 avatar ohare93 commented on June 9, 2024

Please do πŸ‘ I haven't done much testing on Windows myself, so thanks for fixing this πŸ˜„

from brain-brew.

ohare93 avatar ohare93 commented on June 9, 2024

Possibly related to #43? πŸ˜…

from brain-brew.

aplaice avatar aplaice commented on June 9, 2024

Would that also be something interesting

IMO yes, definitely!

Is there cp1252 outside the YAML files? AFAICT all the other (i.e. except the two in yaml_object.py) relevant calls to open explicitly specify a UTF-8 encoding, so the CSV files, HTML files etc. should all just have UTF-8.

(The calls in setup.py and scripts/yamale_build.py also don't have an encoding specified, but that shouldn't affect the main operation of BrainBrew.)

from brain-brew.

Related Issues (16)

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.