Skip to content

Gitinfo fails on unicode filename #3071

@rac2030

Description

@rac2030

Just for fun I added a movie reference, while it works for hugo server run, it fails when I build the output be it locally or on wercker.
I have a File named π.md under content (see http://rac.su and look closer at the footer bar on the right)

Adding it to git works but I noticed git status did list it as "content/\317\200.md"
Hugo fails when building it at
ERROR: 2017/02/21 04:38:02 gitinfo.go:63: Failed to find GitInfo for "content/π.md"

Another example of weird file names is 💩.md which git translates to "content/\360\237\222\251.md" which you can find at http://rac.su/💩 if EnableGitInfo is set to false.

While my case is more fun than anything else, this may also have an effect to other unicode characters like chinese filenames, cyrillic filenames, ... that use unicode.

Searching for unicode in filenames issues, seems like many projects fail on that but there should be some way to enhance hugolib/gitinfo.go to actually handle them correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions