[m-users.] Layout issue with function string.format_table/2 and emoticons in the source strings

Sean Charles (emacstheviking) objitsu at gmail.com
Sun Jun 26 22:29:21 AEST 2022


Hi,

I just tried using the string.format_table function and it produces great output with simple code points but when I added the Smiley face, the layout has broken but it might be a terminal issue? I am using iTerm2 on Monterey.
Is this the expected behaviour or is it an issue in the rendering code?
It feels like the extra code unit for the Smiley internal storage has not been taken into account when calculating the padding.

I took a look at the source code for string.m, the pad_row() predicate, lines 5206 to 5243 of mercury-srcdist-rotd-22.01 but I soon became lost in my train of thought, everything seemed to be using codepoints as the metric for calculating padding etc so I couldn't really find anything wrong. Assuming there is anything wrong which I am not sure of yet of course.


Column 1                                      | Column1                                       | A quick brown fox jumps over the lazy dog.  😀
A quick brown fox jumps over the lazy dog.  😀 | Column 2                                      | Column 2
Column 3                                      | A quick brown fox jumps over the lazy dog.  😀 | Column 3

 > right justified
==================
                                     Column 1 |                                       Column1 | A quick brown fox jumps over the lazy dog.  😀
A quick brown fox jumps over the lazy dog.  😀 |                                      Column 2 |                                      Column 2
                                     Column 3 | A quick brown fox jumps over the lazy dog.  😀 |                                      Column 3




Thanks,
Sean.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/users/attachments/20220626/64fa5c87/attachment.html>


More information about the users mailing list