Advanced Search

Results 1 to 2 of 2

Thread: PHP Excel Special Characters

  1. #1
    Join Date
    Sep 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default PHP Excel Special Characters

    Hi I’m developing a tool that will read in data from an Excel sheet and produce XML files from the data.

    Doing this I’ve found a problem. The Excel has changed some of the character into special characters that PHP can’t read.

    For Example
    EXCEL DATA “Czy przedstawiono Ci instrukcję bezpieczeństwa i higieny pracy (BHP) obowiązującą w firmie?”

    Out Put Data “W którym miejscu najlepiej umie[ ci stopy przed podniesieniem ci | aru?W którym miejscu najlepiej umie[ ci stopy przed podniesieniem ci | aru?”


    As you can see above it has changed!

    I’m using PHP 4 and the below method to read and produce the Output

    PHP Code:
    $data = new Spreadsheet_Excel_Reader();
        
    $data->setUTFEncoder('iconv');
        
    $data->setOutputEncoding("CP-1251");
       
    //$data->setOutputEncoding("UTF-8");
        
    error_reporting(E_ALL E_NOTICE);

    value checker($data->sheets[1]['cells'][$j+1][2]);
    $newphrase html_entity_decode($value); 
    Does anyone know how I can fix this problem???

    Thanks

  2. #2
    Join Date
    Jun 2007
    Posts
    543
    Thanks
    3
    Thanked 78 Times in 78 Posts
    Blog Entries
    1

    Default

    when in save as, for excel, set the encoding
    [Jasme Library (Javascript Motion Effects)] My Site
    /\/\@§†ę® §©®ˇţ† /\/\@|{ę®
    There are 10 kinds of people in the world, those that understand binary and those that don't.

Bookmarks

Posting Permissions

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