Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: utf8 characters

  1. #1
    New Coder
    Join Date
    Feb 2005
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts

    utf8 characters

    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

    example:

    $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("$var1."<br>");
    echo("$var2."<br>"); }
    //output



    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 ???

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    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).


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •