PDA

View Full Version : change $LANG in php


pigpen
2004-08-01, 07:22 AM CDT
Hi all,

I have a php script which gets a nicely formatted webpage viapassthru ("w3m -F -dump http://www.this.net/that.htm");
This works nice when the server-wide $LANG is set to a non-UTF-8 encoding.
Since I prefer not to touch the system-wide encoding, I'd like to know if any of you
could tell me how to set the LANG environment variable in a php script.

(I could use recode, but I want to do it the right way from the very beginning)

pigpen
2004-08-02, 05:10 AM CDT
nobody? :(

pigpen
2004-09-22, 06:47 AM CDT
Answering my own question:

putenv("LC_CTYPE=de_DE@euro");
did the trick :)