Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working with utf8 coding to represent german characters. #16

Closed
mdshane opened this issue Jan 30, 2019 · 3 comments
Closed

Working with utf8 coding to represent german characters. #16

mdshane opened this issue Jan 30, 2019 · 3 comments

Comments

@mdshane
Copy link

mdshane commented Jan 30, 2019

Very useful project and it works perfectly as long as you write your tasks in english. But since I'm German I would prefer to log my activities in German, which includes using characters like ü, ä, ö and so on. This means having the log-file in a format like utf-8. Do you have any idea on how to achieve this easily?

I tried the following up until now and don't know if I only made a mess:

When the file is created by the first hello command it is encoded with charset=us-ascii. Once I add a line using a German symbol the encoding changes to charset=iso-8859-1.

I tried to force your python scripts to work in utf-8 coding using:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
but this solves the problem only for the report-command:
grafik

when using the edit-command the file still does not display the characters correctly, even though the editor is set to utf-8 coding:
2019-01-30 13:22 hello
2019-01-30 13:23 ���

Now i can force the file to be charset=utf-8 using the command line and then the problem is fixed in the editor of course:
2019-01-30 13:22 hello
2019-01-30 13:23 äöü
but then the report-command is messed up again:
grafik

If you have any ideas for an easy solution I would be very happy and I believe other people from all over the world might be interested to simply change the coding maybe in the .config file, to cope with different language-specific characters.
Thanks in advance!

@larose
Copy link
Owner

larose commented Feb 3, 2019

I think this is only an issue with Python 2, did you try with Python 3?

@mdshane
Copy link
Author

mdshane commented Feb 5, 2019

I am working indeed working with Python 3 and I know, that the default setting for Python 3 is utf-8 meaning this should not be a problem. Still I have it.

@larose
Copy link
Owner

larose commented Mar 10, 2019

Sorry for the slow response. I just tried to reproduce your issue but I couldn't:

$ rm ~/.local/share/utt/utt.log 
$ utt hello
$ file ~/.local/share/utt/utt.log 
/home/mathieu/.local/share/utt/utt.log: ASCII text
$ utt add "ü, ä, ö"
$ file ~/.local/share/utt/utt.log 
/home/mathieu/.local/share/utt/utt.log: UTF-8 Unicode text
$ utt report

------------------------ Sunday, Mar 10, 2019 (week 10) ------------------------

Working Time: 0h02 (0h01 + 0h01) [0h02]
Break   Time: 0h00 [0h00]

----------------------------------- Projects -----------------------------------

(0h02) : -- Current Activity --, ü, ä, ö

---------------------------------- Activities ----------------------------------

(0h01) : -- Current Activity --
(0h01) : ü, ä, ö


----------------------------------- Details ------------------------------------

(0h01) 08:48-08:49 ü, ä, ö
(0h01) 08:49-08:50 -- Current Activity --

Perhaps it's an issue with your shell?

@larose larose closed this as completed Apr 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants