krz/crumb

A local alternative to your browser's history. browser-history cli local-first privacy

Commit e2290bfab0

e2290bfab04d203a884165e0352fcdda92a891c3

parent: 8a24fc9d3c

Verified · cmc

cmc <hello@cleberg.net> · 2026-11-01 05:45 UTC

Open history log as UTF-8

Ref #3

Layout: unified · split

search.py +1 −1
@@ -18,7 +18,7 @@ def search_log(query):
18 print("No history file found.") 18 print("No history file found.")
19 return 19 return
20 20
21 with open(LOG_PATH, "r") as f: 21 with open(LOG_PATH, "r", encoding="utf-8") as f:
22 entries = f.read().split("* ")[1:] 22 entries = f.read().split("* ")[1:]
23 23
24 found = 0 24 found = 0
server.py +1 −1
@@ -51,7 +51,7 @@ def log_visit():
51 favicon = data.get("favIconUrl", "") 51 favicon = data.get("favIconUrl", "")
52 timestamp = datetime.utcnow().isoformat() 52 timestamp = datetime.utcnow().isoformat()
53 53
54 with open(LOG_PATH, "a") as f: 54 with open(LOG_PATH, "a", encoding="utf-8") as f:
55 f.write(f"* {title}\n") 55 f.write(f"* {title}\n")
56 f.write(":PROPERTIES:\n") 56 f.write(":PROPERTIES:\n")
57 f.write(f":URL: {url}\n") 57 f.write(f":URL: {url}\n")