Something odd
Posted: Mon Aug 28, 2006 7:09 am
The other day I wrote a script which reads data from Active Directory and inserts it into a MS SQL database. The collation of the db is SQL_Lithuanian_CP1257_CI_AS, so, since the data from AD comes in Unicode, I used iconv() to convert it to Windows-1257 charset. The script does nothing fancy - only read->convert->insert.
The interesting thing is that when I execute the script via http (through Apache on Windows), it works just fine, all the language-specific characters appear in the db as they should. If I execute the same script through CLI, I end up with characters all messed up (in the db). Has anyone else experienced any similar differences between regular and CLI PHP versions? I was wondering if this could be a bug or something else?
The interesting thing is that when I execute the script via http (through Apache on Windows), it works just fine, all the language-specific characters appear in the db as they should. If I execute the same script through CLI, I end up with characters all messed up (in the db). Has anyone else experienced any similar differences between regular and CLI PHP versions? I was wondering if this could be a bug or something else?