Closed yaiqsa closed 3 weeks ago
Hi @yaiqsa,
Thanks for the info.
That errror is coming from Director itself rather than the Netbox import module. The Netbox import module just turns the Netbox data into a format Director can parse, along with a bunch a sanitization. So potentially we could sanitize every field coming in so utf8 is supported.
While I can't think of a specific instance doing this would create a problem, why would anybody need a emoji in Icinga, I'm not omniscient and think it would be better to leave the solution to Director or converting your db from utf8 to utf8mb4 (which I think is director's solution). Trying to implement a solution in the Netbox import module could open a can of worms.
For reference a possible way to implement this in any import module would be a option that enables the sanatization using a checkbox which removes UTF-8-encoded symbols that take up four bytes.
A quick look turns up this
preg_replace('/[\x{10000}-\x{10FFFF}]/u', "\xEF\xBF\xBD", $value);
Thank you for your reply. I think you are right, and my problem is mostly caused by a misconfiguration.
I'll close the issue, because I agree that this isn't necessarily something this module itself should fix. (Unless more people stumble across it in the future)
Hey,
First of all: Cool module! Amazing work ππ»
While playing with an Netbox Import Source in Icinga I came across the following error:
After a lot of debugging, I found out this error is thrown when importing a VM that has an emoji ( π to be precise) in its comments.
After a a bit more searching, I found that my table (and column) were still using character set
utf8
, instead ofutf8mb4
. This page describes the problem & possible solutions nicely: https://mathiasbynens.be/notes/mysql-utf8mb4Is it realistic that I'm not the only one with a utf8 database, and emoji in their Netbox object descriptions? If so, is it worthwhile mentioning something about it/fixing it? (Like replacing offending characters during import, if the wrong character class is detected?)
In any case, people looking for the same error as I had might land on this issue and find their problem π
My environment: