PHP: file() each character is preceded by "\0" -



PHP: file() each character is preceded by "\0" -

i have ini file has been created autohotkey programme written fellow member of team working on. trying read file php array. using built in file() function. when read in file , display using var_dump($file) ($file name of array file beingness read into) each character preceded "\0"(which null character). each has seen happen before? remove null characters after read in file, prefer find solution.

when open ini file in text editors opens fine. read in using file() function desktop.ini file created windows , read in expected, characters not preceded "\0"

it has encoding of file. (most) unicode encodings require 2 bytes per character. means each single byte character prefixed \0. file still valid, if seek read windows-1252 type single byte encoding odd. can seek feeding through utf8_decode , see if clears up. utf 8 potential multibyte encoding 1 4 bytes (with minimum of 1). text editor automatically figure out , opens unicode why looks fine there.

note: because uses 2 byte encoding, not utf-8, may utf-16, utf-8 functions may able parse it.

php file ini autohotkey

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -