lune

created pr with 124.1 on 2026-04-22T02:46:44Z · by 613b58b7
changed status to closed on 2026-06-21T16:45:31Z · by 66ddd677
Closing as superceded by 126
cmds
checkout latest patchset:
ssh pr.pico.sh print 124 | git am -3
checkout any patchset in a patch request:
ssh pr.pico.sh print 124.[rev] | git am -3
add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh pr add 124
set PR to open (enables RSS notifications):
ssh pr.pico.sh pr open 124
set PR to draft (stops RSS notifications):
ssh pr.pico.sh pr draft 124

Patchset 124.1 on 2026-04-22T02:46:44Z · commit 8364d60

listing real name of tasks
juan 2026-04-21T03:21:16Z
construction of db for management of decrypted names of tasks
juan 2026-04-21T05:43:09Z
fix UTF8 chracteres
juan 2026-04-21T21:13:24Z
filter by status and coloring types of status
juan 2026-04-21T21:18:53Z
update help
juan 2026-04-21T21:21:36Z
list areas names
juan 2026-04-21T21:44:53Z
adjust table tasks to truncate name and list area
juan 2026-04-21T21:56:40Z
partial implementation of listing tasks by areas
juan 2026-04-21T22:05:20Z
final implementation of listing tasks by areas with UTF-8 chracteres
juan 2026-04-21T22:10:20Z
sort on task list to show first do now
juan 2026-04-21T22:33:29Z
update with 8 char of id and db.go
juan 2026-04-21T23:27:54Z
partial implementation of TUI menu on task update
juan 2026-04-21T23:35:35Z
task name correcion on TUI menu of Update task
juan 2026-04-21T23:38:19Z
TUI menu for update task with others flags
juan 2026-04-21T23:43:02Z
helper for TUI update task
juan 2026-04-21T23:49:56Z
search by first 8 char of note id for editing it
juan 2026-04-22T00:00:17Z
partial implementation on note TUI menu for update
juan 2026-04-22T00:05:46Z
TUI menu notebook just with tags
juan 2026-04-22T00:20:55Z
Note update now let you insert only the first 8 char of notebook id in update
juan 2026-04-22T00:25:53Z
implementation of (lune note notebook-list) for listing all notebooks and its ID
juan 2026-04-22T01:10:51Z
partial implementation of lune note show-content ID
juan 2026-04-22T02:01:11Z
convert \n in new line and \ in space for lune note show-content ID
juan 2026-04-22T02:18:42Z
fix UTF8 chracteres
juan 2026-04-21T21:13:24Z
Semantic diff summary
0 added, 3 modified, 0 signature changed, 0 removed across 1 analyzed file
+26 -9 internal/db/reader.go #
......@@ -13,6 +13,7 @@ import (
1313 "regexp"
1414 "strings"
1515 "unicode/utf16"
16+ "unicode/utf8"
1617
1718 "github.com/syndtr/goleveldb/leveldb"
1819 "github.com/syndtr/goleveldb/leveldb/opt"
......@@ -89,11 +90,18 @@ func EnrichTask(taskID string) (string, error) {
8990 }
9091
9192 func cleanName(s string) string {
92- b := []byte(s)
93- if len(b) == 0 {
93+ if s == "" {
9494 return ""
9595 }
9696
97+ // If it's valid UTF-8 and contains no null bytes, it's probably fine
98+ if utf8.ValidString(s) && !strings.Contains(s, "\x00") {
99+ return s
100+ }
101+
102+ b := []byte(s)
103+
104+ // Check for UTF-16LE pattern (interleaved nulls)
97105 isUtf16 := false
98106 if len(b) >= 2 {
99107 nullCount := 0
......@@ -107,16 +115,25 @@ func cleanName(s string) string {
107115 }
108116 }
109117
110- if !isUtf16 {
111- return s
118+ if isUtf16 && len(b)%2 == 0 {
119+ utf16s := make([]uint16, len(b)/2)
120+ for i := 0; i < len(utf16s); i++ {
121+ utf16s[i] = binary.LittleEndian.Uint16(b[i*2:])
122+ }
123+ return string(utf16.Decode(utf16s))
112124 }
113125
114- utf16s := make([]uint16, len(b)/2)
115- for i := 0; i < len(utf16s); i++ {
116- utf16s[i] = binary.LittleEndian.Uint16(b[i*2:])
126+ // If it's not UTF-16 but has invalid UTF-8, it's likely Latin-1 (ISO-8859-1)
127+ if !utf8.ValidString(s) {
128+ runes := make([]rune, len(b))
129+ for i, v := range b {
130+ runes[i] = rune(v)
131+ }
132+ return string(runes)
117133 }
118-
119- return string(utf16.Decode(utf16s))
134+
135+ // Fallback: just remove null bytes if it's otherwise valid UTF-8
136+ return strings.ReplaceAll(s, "\x00", "")
120137 }
121138
122139 func isEncrypted(s string) bool {
Back to top