ar51an / raspberrypi-motd

Dynamic Message Of The Day (MOTD) For Raspberry Pi
MIT License
62 stars 14 forks source link

strange character in update.sh #7

Closed BenRoe closed 1 year ago

BenRoe commented 1 year ago

Hello, everything works, but i get some strange character in the headline of the update.sh script.

Bildschirmfoto 2023-09-13 um 22 14 41

If i open the update.sh script here on GitHub in raw, it shows the same character.

Bildschirmfoto 2023-09-13 um 22 18 51

but in normal code view it's fine.

Bildschirmfoto 2023-09-13 um 22 18 30

Any idea what this could cause?

ar51an commented 1 year ago

These are unicode right and left arrows. Right Arrow Left Arrow

This is the screenshot of update.sh in Raw:

image

This is the screenshot when update.sh is executed in shell:

image

I mentioned under putty section in the last screenshot. Make sure whatever client you use it has UTF-8 enabled.

BenRoe commented 1 year ago

Ok thank you for the hint. Are you viewing the raw on windows? I am on Mac and it does not show correct. To make it easier for newbies, replacing these Unicode characters with some standard character like >> << would help. Or if you want some fancy symbols, Nerdfonts is also great. Only a suggestion.

ar51an commented 1 year ago

Yes the github raw screenshot is from win machine but it looks the same in debian and ubuntu as well. Unicode is pretty much the standard across windows, unix and mac-os.

You can try copy/pasting the arrow into a document or display it in character viewer to see if the default font you are using has it. If you are able to view it using one of the these methods than it is the browser that is not able to render it. Firefox renders unicode charcters much better than Safari or Chrome.

The arrows I used above are basic UTF-8 arrows that are available across majority of the fonts in win and unix. They are also renderable in github which supports restricted unicode character set. You can check here various mac fonts have these arrows

I do not want to use any fancy characters, most of them require specific font to be installed. Anyways I will remove them in future release, they are not adding any value to the functionality.

ar51an commented 1 year ago

Removed unicode arrows from update.sh Commit