Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static sync to memory fails with Norwegian "å" #2203

Closed
bep opened this issue Jun 12, 2016 · 4 comments · Fixed by #2259
Closed

Static sync to memory fails with Norwegian "å" #2203

bep opened this issue Jun 12, 2016 · 4 comments · Fixed by #2259

Comments

@bep
Copy link
Member

bep commented Jun 12, 2016

  • Image with Norwegian character "å", aka "ål.jpg" fails to sync in hugo server
  • --renderToDisk works fine, as do regular hugo builds.
  • Curious enough, files with "ø" (another special Norwegian character) works fine ...
@bep bep added the Bug label Jun 12, 2016
@ks888
Copy link
Contributor

ks888 commented Jul 6, 2016

I think it is normalization problem.

https://blog.golang.org/normalization

As well as é, there are several ways to represent å. In NFC, å is \xc3\xa5. In NFD, it is \x61\xcc\x8a.

NFC is used in most cases, but in Mac OS's HFS+ file system, a file name is automatically normalized to NFD. Even if we save a file name in NFC, we need to use NFD to open the file.

In this issue's case, Hugo server is able to serve ål.jpg file, but we need to use NFD to access it. Since å character in markdown/html file are represented in NFC, we are unable to access ål.jpgfile.

I think this issue can be fixed by normalizing a file name to NFC when files are added to Hugo's filesystem, so that we can use NFC to access files in any cases.

@bep
Copy link
Member Author

bep commented Jul 6, 2016

@ks888 thanks for this. It would be nice, though, if this fix could be applied to Afero (the VFS in use). I will look into this a little bit later.

/cc @spf13

@ks888
Copy link
Contributor

ks888 commented Jul 7, 2016

I understand afero as the abstraction layer of various filesystems, and I wonder if normalizing a file name is out of scope.
But, in practice, it sounds very useful if afero normalizes a file name in NFD to NFC.

@github-actions
Copy link

github-actions bot commented Apr 4, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants