andmarti1424 / sc-im

sc-im - Spreadsheet Calculator Improvised -- An ncurses spreadsheet program for terminal
Other
4.87k stars 208 forks source link

format including extra space when alternate currencies/special characters (¥/€) are present #891

Open photosheep opened 2 months ago

photosheep commented 2 months ago

Using the following snippet

let A0 = 100
fmt A0 "¥0.00"
let A1 = 200
fmt A1 "$0.00"
let A2 = 300
fmt A2 "🐑0.00"
goto A2

Spaces appear after the items formatted with $. Most special characters seem to break the spacing. The input bar also returns the following. A2 (🐑0.00) 20[300] This seems to be an artifact of the strange spacing as well.

andmarti1424 commented 2 months ago

@photosheep I am not able to see the first char on A2. what is it?

photosheep commented 2 months ago

An emoji. Some special characters (€ 🐑 √) seem to indent the right side worse than others (¥ ¡ ×), but they all seem to offset the entire line to the left by a space or two.

andmarti1424 commented 2 months ago

I believe this has to do with wcslen and how it interprets and processes each wide character.. I cannot do much regarding this I am afraid.

andmarti1424 commented 2 months ago

BTW, the special characters not shown are just because ncurses does not support them. Again, nothing much I can do about that either.