1

I am refering to these: gettext and iconv extensions. The gettext extension implies a support for language translation provided by the GNU software and the same goes for iconv, I just don't understand if these two are similar or different.

ʎɹnɔɹǝW
  • 811
  • 2
  • 8
  • 14
  • 1
    They're nothing alike - `inconv` is primarily concerned with character encoding whereas `gettext` allows you to bind translations to a "domain" by using the `_` function; e.g. `= _("Apple"); ?>` could output "Apple" by default or "Apfel" on a German language domain via a `.po` file in which you've defined that "Apple" is "Apfel" ... though there are obvious limitations with that approach. See: http://www.onlamp.com/pub/a/php/2002/06/13/php.html as an example – CD001 Jan 16 '17 at 15:27
  • @CD001 Thanks, that explains 99% about gettext and I love the link too, but I am still short on `iconv` could you illustrate a bit, also please make it an answer so I can accept. – ʎɹnɔɹǝW Jan 16 '17 at 15:47
  • To be honest, if you're working on any kind of PHP project that requires i18n, you probably just need http://stackoverflow.com/questions/279170/utf-8-all-the-way-through/279279 plus `Intl` (esp. NumberFormatter) - I can't remember the last time I used `iconv`; juggling character encoding usually ends in tears. – CD001 Jan 16 '17 at 15:55

0 Answers0