Z-Hub / Z-Push

Home of Z-Push
https://z-push.org
GNU Affero General Public License v3.0
97 stars 47 forks source link

Add configuration for //IGNORE and //TRANSLIT for iconv #27

Closed matidau closed 5 months ago

matidau commented 1 year ago

We could add //IGNORE to the charset string, but this will cause the characters to drop. Not sure this is desirable behaviour.

https://www.php.net/manual/en/function.iconv.php

If the string //IGNORE is appended, characters that cannot be represented in the target charset are silently discarded. Otherwise, E_NOTICE is generated and the function will return false.

There is also //TRANSLIT but this still has a chance of returning false, depending on the implementation. If this is used we would need to then check the result and call it again with //IGNORE to ensure that it always works.

Ideally we would make a config variable so this can be defined per system, this makes it a less simple bug fix though, possibly more a feature, so would prefer to handle in another PR.

Originally posted by @matidau in https://github.com/Z-Hub/Z-Push/pull/21#issuecomment-1694776010