Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

findutils updatedb fails on some filename encodings #47791

Closed
sparr opened this issue Jan 6, 2016 · 7 comments
Closed

findutils updatedb fails on some filename encodings #47791

sparr opened this issue Jan 6, 2016 · 7 comments

Comments

@sparr
Copy link

sparr commented Jan 6, 2016

$ sudo updatedb
/usr/bin/sort: string comparison failed: Illegal byte sequence
/usr/bin/sort: Set LC_ALL='C' to work around the problem.
/usr/bin/sort: The strings compared were `/LIBRARY/FONTS/ō\216Ɩ\207ǻ\206ɻ\221.TTF' and `/LIBRARY/FONTS/ō\216Ɩ\207ɻ\221Ľ\223.TTF'.

While I can set the environment variable that sort is looking for myself, I sorta expect updatedb to handle this for me.

@UniqMartin
Copy link
Contributor

Can you please paste the output of locale and env | egrep '^(LANG=|LC_)' | sort? I suspect you're not using an UTF-8 locale which sort relies on to work correctly.

@sparr
Copy link
Author

sparr commented Jan 7, 2016

$ locale
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL=
$ env | egrep '^(LANG=|LC_)' | sort
LANG=en_US.UTF-8

@UniqMartin
Copy link
Contributor

Your locale settings seem to be fine. I'm afraid you just discovered a bug in either updatedb (or worse in Apple's sort), in which case we can't help. You could try searching if this is a known issue and if not, report it upstream. If all else fails, you might have to use the workaround suggested by sort.

@sparr
Copy link
Author

sparr commented Jan 7, 2016

reported upstream at https://savannah.gnu.org/bugs/index.php?46846

@sparr
Copy link
Author

sparr commented Jan 7, 2016

temporary workaround is to export LC_ALL='C' at the top of the updatedb script

@UniqMartin
Copy link
Contributor

reported upstream at https://savannah.gnu.org/bugs/index.php?46846

Thank you! Please let us know once the bug is confirmed upstream and there's a fix we can apply. We can add that to the formula until there's an update that contains the fix.

@sparr
Copy link
Author

sparr commented Jan 13, 2016

Thanks @DomT4 @UniqMartin

@Homebrew Homebrew locked and limited conversation to collaborators Jul 10, 2016
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