problem encoding from cyrillic to latin

Discussion in 'PHP' started by bumbar, May 19, 2009.

  1. #1
    Hallo!

    I have a problem with the display of result in Latin browser

    translated through Google translator from Bulgarian to English, but the browser appears errors enkoding

    I used iconv, mbstring by PHP, but problem still exists ...

    here is simple code

    
    require('googleTranslateTool.class.php');
    
    // initiate the translator with the settings from english to spanish, for full language list check the main class file
    $translator = new googleTranslateTool('bg','en');
    
    $result = $translator->translate_Text('как се чувстваш');
    
    if ( $result===false ) echo $translator->return_error();
    else echo $result;
    
    echo iconv("windows-1251", "utf-8", $result);
    
    PHP:
    thanx.
     
    bumbar, May 19, 2009 IP
  2. szalinski

    szalinski Peon

    Messages:
    341
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    first of all, is your actual php source file utf8 without BOM?

    second, what is output at the line "else echo $result;" - what sort of output occurs there?

    third, based on my second point, i can't determine what the propert input encoding would be.
     
    szalinski, May 22, 2009 IP