rpi-led-matrix icon indicating copy to clipboard operation
rpi-led-matrix copied to clipboard

Unicode (16-bit) character warning

Open konstk1 opened this issue 1 year ago • 1 comments

Whenever a string includes a 16-bit Unicode character, the library keeps printing the warning below. The character is correctly displayed on the matrix screen. So this is more of an annoyance.

"" character not found for the 6x10 font.

I verified this is specific to 16-bit Unicode. I tried a string with \u{ff}, which works fine. Replacing that with \u{100} starts logging that message.

konstk1 avatar Jan 21 '24 23:01 konstk1

After some quick research, the place that prints this message uses a for loop to iterate over characters of a string. However, this doesn't work with utf-16.

Here's what it looks like if you try to iterate over

  const string s = "0↑";

  for (auto c : s) {
    cout << uint_least32_t(c) << endl;
  }
-------
  48
  4294967266
  4294967174
  4294967185

konstk1 avatar Jan 21 '24 23:01 konstk1