Giter Club home page Giter Club logo

Comments (10)

stephencelis avatar stephencelis commented on July 28, 2024

+1

Tested in 1.9.2 where Grit::Repo#commits had been raising ArgumentError: invalid byte sequence in UTF-8.

from grit.

antage avatar antage commented on July 28, 2024

Similar error in 1.9.2 (String#getord): http://github.com/github/gollum/issues#issue/17

from grit.

dstrelau avatar dstrelau commented on July 28, 2024

+1 Fixes isuses with gollum.

from grit.

postmodern avatar postmodern commented on July 28, 2024

When can we have a release that fixes this?

from grit.

antage avatar antage commented on July 28, 2024

grit 2.2.0 + gollum 1.0.1 have same bug:

ArgumentError - invalid byte sequence in UTF-8:
 /opt/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/grit-2.2.0/lib/grit/ruby1.9.rb:3:in `ord'
 /opt/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/grit-2.2.0/lib/grit/ruby1.9.rb:3:in `getord'

from grit.

stephencelis avatar stephencelis commented on July 28, 2024

While the topic branch has been applied and the general encoding issue fixed, an additional encoding issue exists when attempting to commit a blob with a UTF-8-encoded name.

index.add "Café", "blah"
index.commit "message", nil, actor, tree

Results in:

Encoding::CompatibilityError: incompatible character encodings: UTF-8 and ASCII-8BIT
 grit (2.3.0) lib/grit/index.rb:137:in `%'
 grit (2.3.0) lib/grit/index.rb:137:in `block in write_tree'
 grit (2.3.0) lib/grit/index.rb:132:in `each'
 grit (2.3.0) lib/grit/index.rb:132:in `write_tree'
 grit (2.3.0) lib/grit/index.rb:80:in `commit'

I've fixed this in my app by forcing the encoding of my string, beforehand, to ASCII-8BIT, and monkey-patching Grit::GitRuby::Internal::LooseStorage#get_raw_object to try content.force_encoding 'UTF-8' if content.length != size`, but I assume the library-specific fix shouldn't be so 1.9-heavy.

from grit.

hiroshi avatar hiroshi commented on July 28, 2024

FYI, I'v just send a pull request, fixing one of ruby 1.9 encoding problem.

#51

from grit.

Dahie avatar Dahie commented on July 28, 2024

For the record, I'm having the same problem as stephencelis. I'm using version 2.4.1 of grit. Is there a solution in the works for this?

from grit.

brodock avatar brodock commented on July 28, 2024

We are experiencing the same type of problem with Gitlab, and I've a alternative that may help fix this issue, as commented here: https://github.com/gitlabhq/gitlabhq/issues/725

from grit.

bkeepers avatar bkeepers commented on July 28, 2024

Grit is no longer maintained. See #183 and check out libgit2/rugged.

from grit.

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.