View Full Version : utf8 characters

07-13-2005, 03:32 AM
Using 'file_get_contents' to bring in a list of Japanese characters
from a text file I drop them into a array

$array[0] // 大-表

Next array's which contain "-" are split into two var's
It is working BUT
only when I hardcode utf-8 characters


$utf8 = "$array[0]"; // dont work

$utf8 = "大-表"; // works

if(($n = strpos($, '-')) !== false) {
$var1 = substr($utf8, 0, $n-1);
$var2 = substr($utf8, $n);
$var1 = str_replace ("-", "", $var1);
$var2 = str_replace ("-", "", $var2);
echo("$var2."<br>"); }

Im able to work with the utf-8 array's in other scripts using str_replace
however this function I guess is in another format

any ideas why this is ???

07-13-2005, 09:50 AM
This is an interesting question, one I've never thought up before.
Perhaps you can give a post containing this text file, or at least a couple of characters? My system is incapable of creating the characters needed (at least, easily).