kenorb-contrib/tg

Weird characters in CLI output

bytes-commerce opened this issue · 12 comments

I am seeing these characters in the CLI output. Any idea whats causing them and how I could get rid of them? I am using the latest build of this repository and just built the program.

image

In the terminal: (Raspberry Pi)
locale
LANG=de_DE.UTF-8
LANGUAGE=
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=

My locale:

LANG=de_DE.UTF-8
LANGUAGE=de_DE
LC_CTYPE=de_DE.UTF-8
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=

I think LANGUAGE is false.
Try sudo update-locale LANG=de_DE.UTF-8 and reboot or restart terminal. Look if locale and Telegram-CLI is better.

This hasn't changed the LANGUAGE key for me. Checked on a ZSH console for what its worth it.

Ok, make cat /etc/default/locale and look what there in.

Sure:

#  File generated by update-locale
LANG=de_DE.UTF-8
LANGUAGE=de_DE

Ok, delete LANGUAGE=de_DE with sudo nano /etc/default/locale

Done, restarted Terminal, same output.

However, if I switch over to TTY1 and try to do it, it works. But thats a Bash console over there and in Terminator I have ZSH: zsh 5.4.2 (x86_64-ubuntu-linux-gnu)

same output.

You mean Telegram-CLI?

Yes, sorry for not being clear. telegram-cli in ZSH console still has the weird characters. I can switch over to Bash terminal where it runs fine in the same instance of machine.

Look there on Point 6.

Screenshot_20200609-050617(1)

I'm seeing some odd characters aswell, after converting them to their Unicode values it appears, in front of channel names are two characters

  1. which is apparently Unicode character (U+001) or its ISO name "<Start of Heading> (SOH)" Link with more info on the character
  2. which is apparently Unicode character (U+002) or its ISO name "<Start of Text> (STX)" Link with more info on the character
    These characters appear before and after a channel name in the pattern (1)(2)ChannelName(1)(2)

    Here is an example: Channel ��BadDadJokes��: 387 unread
    And sometimes (notably around contacts names where they both appear doubled before and after the name) they appear more around different parts of the line.

Any ideas?

I've messed around a little and it doesn't appear to be a font or a language issue or something that's causing those characters to be printed. I'd look through the code myself further but, I don't understand the code or how it's structured and I am also still learning C