• Resolved mistyfx

    (@mistyfx)


    Hi, I found some bug in displaying tables – first character is not shown if contain national specific characters – In my case from czech language like “?, ?, ?, etc.”.

    How to replicate:

    [table caption="Víno"]
    Název vyrobku¤Kategorie¤Mno?ství¤Cena bez DPH¤Cena s DPH
    ?umivé¤Révové víno ?umivé - brut¤0,75 l¤29,70 K?¤59 K?
    [/table]

    Result (shorted…): “umivé Révové víno ?umivé – brut”

    Workaround: add for example “.” as first character.

    [table caption="Víno"]
    Název vyrobku¤Kategorie¤Mno?ství¤Cena bez DPH¤Cena s DPH
    .?umivé¤Révové víno ?umivé - brut¤0,75 l¤296,70 K?¤359 K?
    [/table]

    Result (shorted…): “.?umivé Révové víno ?umivé – brut”

    https://www.ads-software.com/plugins/easy-table/

Viewing 3 replies - 1 through 3 (of 3 total)
  • I have also the same problem, but adding a . as first characters is not a good solution because i’m using the tablesorter. Any fix for this?

    Plugin Author takien

    (@takien)

    Hello, this is an old bug and I still don’t have idea to deal with it.
    And yes, wrapping first column with quote would ‘solve’ this.

    Hi, I have the same problem. It seems it caused by fgetcsv function which is called from easy_table_str_getcsv function. Function fgetcsv uses system locale setting, so it depends how is it set on your site – try echo setlocale(LC_ALL, 0). Here is a fix which helped in my case, where system locale was set to “C”. I changed locale to specific value cs_CZ.UTF-8 just for the fgetcsv loop, it is set back after

    $option = get_option(‘easy_table_plugin_option’);
    $limit = !empty($option[‘limit’]) ? (int)$option[‘limit’] : 2000;
    $oldLocale = set_locale(LC_ALL, 0);
    setlocale(LC_ALL, ‘cs_CZ.UTF-8’);
    while (($data = @fgetcsv( $handle, $limit, $delimiter, $enclosure )) !== FALSE) {
    $num = count($data);
    for ($c=0; $c < $num; $c++) {
    $line++;
    $data[$c] = str_replace(‘NLINEBREAK’,”\n”,$data[$c]);
    $data[$c] = str_replace(‘RLINEBREAK’,”\r”,$data[$c]);
    $data[$c] = str_replace(‘_ESCAPED_SEPATATOR_’,$delimiter,$data[$c]);
    $return[$line] = $data[$c];
    }
    }
    fclose($handle);
    setlocale(LC_ALL, $oldLocale);
    return $return;

    It will make sense to experiment a bit with various system settings, or replace usage of fgetcsv with another solution (parsing csv isn’t so difficult to do it in code of plugin) not dependant on system locale setting.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘National first character missing bug’ is closed to new replies.