Closed o-pteron closed 6 years ago
I can't reproduce.
:~$ t -V | head -1
TODO.TXT Command Line Interface v2.10
:~$ cat tmp/sort.test.txt
(A) Task
ÆØÅ
(B) Task 2
(C) Task 3
Task 4
:~$ t lf tmp/sort.test.txt
1 (A) Task
3 (B) Task 2
4 (C) Task 3
5 Task 4
2 ÆØÅ
--
SORT: 5 of 5 tasks shown
:~$ cat .todo/config
export TODO_DIR="$HOME/Dropbox/todo"
export TODO_FILE="$TODO_DIR/todo.txt"
export DONE_FILE="$TODO_DIR/done.txt"
export REPORT_FILE="$TODO_DIR/report.txt"
export TMP_FILE="/tmp/todo.tmp"
export TODOTXT_DEFAULT_ACTION=ls
I was going to suggest you try a stripped down config file, but I can't reproduce even with your provided config file. That makes me think it's a locale issue.
What does sort --version
say?
What does locale
say?
Thank you for your help.
As requested:
opteron@thor:~$ sort --version
sort (GNU coreutils) 8.25
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Mike Haertel and Paul Eggert.
opteron@thor:~$ locale
LANG=en_DK.UTF-8
LANGUAGE=en_US
LC_CTYPE="en_DK.UTF-8"
LC_NUMERIC="en_DK.UTF-8"
LC_TIME="en_DK.UTF-8"
LC_COLLATE="en_DK.UTF-8"
LC_MONETARY="en_DK.UTF-8"
LC_MESSAGES="en_DK.UTF-8"
LC_PAPER="en_DK.UTF-8"
LC_NAME="en_DK.UTF-8"
LC_ADDRESS="en_DK.UTF-8"
LC_TELEPHONE="en_DK.UTF-8"
LC_MEASUREMENT="en_DK.UTF-8"
LC_IDENTIFICATION="en_DK.UTF-8"
LC_ALL=en_DK.UTF-8
I'll play around with some virtual machines and see if I can reproduce the error on other systems.
I found the problem. LC_ALL=en_DK.UTF-8 seems to mess up the sorting. You can reproduce the error using: export LC_ALL=en_DK.UTF-8
Yep, that will do it. How is LCALL being set? It shouldn't be set in any configuration files and should only be set by/for individual scripts or programs that need it. It overrides all of the other LC settings. See this stackoverflow answer https://unix.stackexchange.com/a/87763
LC_ALL is not being set by todo.txt, I might have done it myself. Thank you very much for your help and the link about LC_ALL
Happy to help. Gave me a good excuse to learn more about locale variables. If you've fixed it on your end you can close this issue.
Hello todotxt
Thank you for creating this wonderful tool. I have problems with todo.txt-cli concerning sorting and special characters like æ, ø and å. Please bear with me as I'm neither a programmer nor a native english speaker.
When listing tasks the sorting seems broken when the task contains special characters like æ, ø and å. Even when I've used the following from Tips & Tricks in todo.cfg:
export TODOTXT_SORT_COMMAND='env LC_COLLATE=C sort -k 2,2 -k 1,1n'
Reproduce the error: 1) Insert a task containing "ÆØÅ" in todo.txt, like this:
2) Tasks will be listed like this:
I would expect tasks without priority being placed below prioritized tasks.
My setup: KDE Neon latest version
todo.txt downloaded from https://github.com/todotxt/todo.txt-cli/releases/download/v2.10.0/todo.txt_cli-2.10.tar.gz
Thank you for your time Sincerely Kasper