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

Add warning on startup if locale/language suggests missing "icons" #256

Closed
neiljp opened this issue Jan 14, 2019 · 4 comments
Closed

Add warning on startup if locale/language suggests missing "icons" #256

neiljp opened this issue Jan 14, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@neiljp
Copy link
Collaborator

neiljp commented Jan 14, 2019

At least one user reported that the screen had question marks or similar, and it turned out their locale did not include UTF-8.

We do note that eg. en_US.UTF-8 is suggested in the FAQs, though I personally use en_GB.UTF-8 and the drawing lines and so on all work fine. However, if I run LANG=en_GB zulip-term then the top lines are instead ????, and the bullets for the top-left buttons and users are also ?.

Given that we can detect the LANG setting by accessing the environment variables, we should be able to give a warning on startup that the icons/lines may be incorrect/unexpected.

Beyond this, in future we could aim to be adaptable:

  • detect non-UTF-8 and use different characters for the top lines or bullets
  • better font (UTF-16? some other way of detecting?) and use more complex icons
@neiljp neiljp added the enhancement New feature or request label Jan 14, 2019
@amanagr amanagr assigned amanagr and unassigned amanagr Jan 14, 2019
@amanagr
Copy link
Member

amanagr commented Jan 14, 2019

From my past experience with urwid, I would say it's a bad idea to implement complex icons even if we detect UTF-16 support or better, since some characters are differently interpreted by different terminals on the same OS and they end up distorting display for ZT and you can't predict which icon may give you problems.

@neiljp
Copy link
Collaborator Author

neiljp commented Jan 14, 2019

@amanagr I was focusing this issue initially just on the UTF-8 issue with lines and bullets, though I do agree generally that this could get overly complex very easily.

That said, an alternative approach may be to generalize themes beyond colors to include icons (or have 'icon themes'), and keep the default theme as simple (and working!) as possible, while allowing other icons on more potentially-compatible displays?

@amanagr
Copy link
Member

amanagr commented Jan 15, 2019

Even for a most capable system these factors are important in rendering a successful "icon theme":

  • Font Used (some fonts are unable to render specific icons.)
  • Terminal used (basically terminal input-output stream behaviour)
  • OS
    • Windows -> No rendering icons / double width characters on WSL.
    • Linux -> I faced problem with Ubuntu 16 being able rendering an icon and Ubuntu 18 unable to in ZT.
    • Mac OS -> Works fine...

Ezio-Sarthak added a commit to Ezio-Sarthak/zulip-terminal that referenced this issue Apr 13, 2021
This commit shows the warning message during loading, if UTF-8 encoding
isn't found enabled in the locale.

NOTE: The warning might be shown even if icons are rendering properly. This
might be due to default UTF support for some terminals. However, this could
be a potential risk with other OS (e.g., WSL) and hence robust for such
scenarios.

Test added.

Fixes zulip#256.
@neiljp
Copy link
Collaborator Author

neiljp commented Apr 15, 2021

There haven't been significant known issues related to UTF-8 in this way for some time that I'm aware of. As discussed in #zulip-terminal>ZT crashing when scrolling down the user list it therefore feels appropriate to close this issue now and remove the advice given in the FAQ. The latter will take place shortly in #979 (testing symbol rendering using shipped script + FAQ entry changes).

Given this decision I'm closing this issue, and as per the discussion mentioned above, this removes the need for #994, an intended fix.

The approach of icon themes has been isolated into #938 recently, which will likely be the longer-term solution to make the most of systems with minimal/typical/advanced icon/font/symbol support, and which is the expected solution to the problem described in #178.

@neiljp neiljp closed this as completed Apr 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants