Skip to content

Commit

Permalink
fixed LANG different than en_US and unicode strings in window titles
Browse files Browse the repository at this point in the history
  • Loading branch information
Matěj Šmíd committed Dec 8, 2014
1 parent 3ef332e commit 676b402
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions export_events.py
Expand Up @@ -16,7 +16,7 @@ def loadEvents(fname):
events = []

try:
ws = open(fname, 'r').read().splitlines()
ws = open(fname, 'r').read().decode('utf-8').splitlines()
events = []
for w in ws:
ix = w.find(' ') # find first space, that's where stamp ends
Expand Down Expand Up @@ -108,7 +108,7 @@ def updateEvents():
print 'wrote ' + fwrite

fwrite = os.path.join(RENDER_ROOT, 'export_list.json')
open(fwrite, 'w').write(json.dumps(out_list))
open(fwrite, 'w').write(json.dumps(out_list).encode('utf8'))
print 'wrote ' + fwrite

# invoked as script
Expand Down
2 changes: 2 additions & 0 deletions keyfreq.sh
Expand Up @@ -5,6 +5,8 @@
# in logs/keyfreqX.txt every 9 seconds, where X is unix timestamp of 7am of the
# recording day.

LANG=en_US.utf8

helperfile="logs/keyfreqraw.txt" # temporary helper file

mkdir -p logs
Expand Down
2 changes: 2 additions & 0 deletions logactivewin.sh
@@ -1,5 +1,7 @@
#!/bin/bash

LANG=en_US.utf8

# logs the active window titles over time. Logs are written
# in logs/windowX.txt, where X is unix timestamp of 7am of the
# recording day. The logs are written if a window change event occurs
Expand Down

0 comments on commit 676b402

Please sign in to comment.