Hacker News new | ask | show | jobs
by saagarjha 2299 days ago
Oh boy, neither GCC nor Clang liked the Unicode one bit:

  $ make 2>&1 | head
  c++ -std=c++17 -Wall -Wextra -Os -MD -MP -MF cxxmatrix.dep -c -o cxxmatrix.o cxxmatrix.cpp
  In file included from cxxmatrix.cpp:595:
  glyph.inl:78:2: error: converting to execution character set: Invalid argument
     78 | {U'�', 21, {127, 65, 65, 65, 65, 65, 127, }},
        |  ^~~~
  glyph.inl:79:2: error: converting to execution character set: Invalid argument
     79 | {U'�', 21, {573695, 2072768, 104616, 104344, 37000, 1609860, 430211, }},
        |  ^~~~
  glyph.inl:80:2: error: converting to execution character set: Invalid argument
     80 | {U'�', 21, {164354, 260859, 2015779, 1221155, 692770, 429602, 1238014, }},
4 comments

Thank you. This issue is discussed here https://github.com/akinomyoga/cxxmatrix/issues/3

It is caused by the UTF-8 unaware awk. I haven't yet figured out why it happens, but at least you need to set your locale to one of UTF-8 locales.

You made it further than I did. The majority of machines out there today probably do not support the required -std=c++17. I know none of my OS installs (and their compilers) do.
I think Xcode has shipped with a compliant C++17 compiler for over a year, but I used GCC to compile this one :)
GCC has supported this for more than a year, too (at least since 7.4.0).
GCC 7.4.0 sadly misses certain C++ features (filesystems) and does not correctly support others (template argument deduction). I'm waiting for 20.04 to hopefully bump GCC to something newer…
I was able to fix it by find all 'ï' and replace with '\U000000EF' in glyph.inl
I fixed this on my mac (High Sierra) with:

brew install gawk

make clean

make

And shortly after, I did this:

brew cask install iterm2