gollum / rugged_adapter

Adapter to make gollum use Rugged (libgit2) at the backend.
MIT License
36 stars 27 forks source link

page.raw_data not get converted to utf-8 #5

Closed buger closed 6 years ago

buger commented 9 years ago

After switching to rugged adapter i started getting incompatible character encodings: ASCII-8BIT and UTF-8 errors and found that page.raw_data is returned in ASCII-8BIT encoding (was utf-8 using grit). I guess this should be converted inside adapter.

dometto commented 9 years ago

Thanks @buger, we'll be sure to address this before the first non-beta release.

bartkamphorst commented 8 years ago

The ASCII-8BIT encoding is set on purpose in rugged "since Git is encoding agnostic". See here. It would seem that in some instances page#text_data (see here) would be preferable over page#raw_data. @buger Do you recall which call to page.raw_data was giving you trouble?

dometto commented 8 years ago

It does seem to me like this shoud be handled by replacing #raw_data calls in gollum-lib to #text_data calls. It seems ok that the adapter just returns blob contents in ASCII-8. Should we close this and open a gollum-lib issue, @bartkamphorst?

dometto commented 8 years ago

Hmm, on second thought, it seems like and gollum and gollum-lib already use text_data when it comes to displaying the contents of a page. raw_data is used when showing the contents of a non-page file (which is arguably good), and in the following places:

Not sure if it should be changed in any of those places.

bartkamphorst commented 8 years ago

Exactly. Which is why I wanted to know which call specifically was causing trouble. :)

dometto commented 8 years ago

Agree. Ping @buger, can you help us reproduce your issue/point to the raw_data call in question?

buger commented 8 years ago

sure, I'll try to re-create test case

bartkamphorst commented 8 years ago

@buger Any luck re-creating a test case?

buger commented 8 years ago

Sorry, but I'm not working on this project anymore

On Wednesday, 31 August 2016, Bart Kamphorst <notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com');> wrote:

@buger https://github.com/buger Any luck re-creating a test case?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gollum/rugged_adapter/issues/5#issuecomment-243871679, or mute the thread https://github.com/notifications/unsubscribe-auth/AAA2uVsap43KX2JU94DTZKlz0msbiOYRks5qldQDgaJpZM4DoumK .


https://goreplay.org - test your system with real data @buger https://twitter.com/buger - me on twitter

dometto commented 6 years ago

This should be resolved in 5.x, at least utf-8 contents are displaying fine. Closing because of no further info on how to reproduce.