Strings containing emoji characters have incorrectly sized cells
mmatheson opened this issue · comments
Matt Matheson commented
On Linux:
tabulate::Table example;
example.add_row({"header"});
example.add_row({"✔"});
example.print(std::cout);
Generates
+--------+
| header |
+--------+
| ✔ |
+--------+
Pranav commented
You should enable multi-byte character support using example.format()
.
For performance reasons, this is disabled by default.
See more here.
#include <tabulate/table.hpp>
#include <iostream>
int main() {
tabulate::Table example;
example.add_row({"header"});
example.add_row({"✓"});
example.format()
.multi_byte_characters(true);
std::cout << example << "\n";
}
should print:
+--------+
| header |
+--------+
| ✓ |
+--------+
Please confirm that this works on your side. If it does, please close the issue.
Matt Matheson commented
Yep that works, thanks for the help!