Special Characters not showing after cpmfetch manipulation Special Characters not showing after cpmfetch manipulation
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Special Characters not showing after cpmfetch manipulation

Started by CandyEyes, November 24, 2012, 07:03:57 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

CandyEyes

Hi! This si my site http://candyeyes.es/portfolio and after I applied the code below in the theme.php file so I could make the latest images of the gallery show up (cause it's on the cpmfetch gallery is on the same folder as the index.php file), I have an issue with the special characters, cause they're not showing up correctly. For example: the € charactes displays as â,¬, as you can see in my site.

function pageheader($section, $meta = '')
{
    global $CONFIG, $THEME_DIR;
    global $template_header, $lang_charset, $lang_text_dir;

   

   
ob_start();
    include "/home/candyeye/public_html/portfolio/cpmfetch/cpmfetch.php";
    $objCpm = new cpm("/home/candyeye/public_html/portfolio/cpmfetch/cpmfetch_config.php");
    $options = array( 'imageheight' => '40', 'imagewidth' => '30', 'imagestyle' => 'image100');
    $objCpm->cpm_viewLastAddedMedia(2,6, $options);
    $objCpm->cpm_close();
    $cpmfetch_latest = ob_get_clean();

    $template_vars = array(
        '{LANG_DIR}' => $lang_text_dir,
        '{TITLE}' => theme_page_title($section),
        '{CHARSET}' => $charset,
        '{META}' => $meta,
        '{GAL_NAME}' => $CONFIG['gallery_name'],
        '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
        '{SYS_MENU}' => theme_main_menu('sys_menu'),
        '{SUB_MENU}' => theme_main_menu('sub_menu'),
        '{ADMIN_MENU}' => theme_admin_mode_menu(),
        '{CUSTOM_HEADER}' => $custom_header,
        '{JAVASCRIPT}' => theme_javascript_head(),
        '{MESSAGE_BLOCK}' => theme_display_message_block(),
'{CPMFETCH_LATEST}'  => $cpmfetch_latest,
    );
   
    $template_vars = CPGPluginAPI::filter('theme_pageheader_params', $template_vars);
    echo template_eval($template_header, $template_vars);

    // Show various admin messages
    adminmessages();
}


I've been looking in the forum, and could it be a problem with UTF8 or language coding? cause I swear I didn't change anything more than adding the that code. As help given on some threads of this forum, I tried to change the ITF8 to iso-8859-2 (Central European, as the language is spanish) and nothing changed. I also tried to add the charset function like this:
function form_charset($optionvalue, $selected)
  {
        global $CONFIG;
   
   
        $charsets = array(//'Default' => 'language file',
                          'Arabic' => 'iso-8859-6',
                          'Baltic' => 'iso-8859-4',
                          'Central European' => 'iso-8859-2',
                          'Chinese Simplified' => 'euc-cn',
                          'Chinese Traditional' => 'big5',
                          'Cyrillic (windows-1251)' => 'windows-1251',
                          'Cyrillic (koi8-r)' => 'koi8-r',
                          'Greek' => 'iso-8859-7',
                          'Hebrew' => 'iso-8859-8-i',
                          'Icelandic' => 'x-mac-icelandic',
                          'Japanese' => 'euc-jp',
                          'Korean' => 'euc-kr',
                          'Maltese' => 'iso-8859-3',
                          'Thai' => 'windows-874',
                          'Turkish' => 'iso-8859-9',
                          'Unicode' => 'utf-8',
                          'Vietnamese' => 'windows-1258',
                          'Western' => 'iso-8859-1'
                          );
   
        //$value = strtolower($CONFIG['charset']);

   
        echo "<select name=\"$optionvalue\">";
        foreach ($charsets as $country => $charset)
        {
            echo "<option value=\"$charset\" " . ($selected == $charset ? 'selected="selected"' : '') . ">$country ($charset)</option>\n";
        }
        echo "</select>";
    }

and no result. Could anyone help me to make the special characters show up as they are?

Thanks.


CandyEyes

Quote from: Veronica on November 24, 2012, 09:47:20 PM
This discussion might interest you
http://stackoverflow.com/questions/4640354/hex-representation-of-euro-symbol
Hi, Veronica....I checked it out, and I understand it's the character encodings. But I don't know what I should change on my coppermine gallery files or theme to make the characters show as they are....Thank you.

CandyEyes

Ok...my characters are showing correctly...the thing is that I don't know if they're shoring because I changed the encoding to Central Europe on the configuration of the gallery system menu or it's because there it was something else. My site had a 500 Internal server ewrror and was down for a while and when the problem was solved by the server supplier, the characters were showing again....
Thanks a lot to everyone for trying, but styill don't knwo what the problem was, sorry....

phill104

As far as I can see none of the changes you made to your them with cpmfetch would have affected the encoding. If it is fixed now I doubt we will ever know the cause. Good luck with your site, you've done a great job integrating the cpmfetch images to your theme.
It is a mistake to think you can solve any major problems just with potatoes.

Veronica

Your page is set to be windows-1252 and when I change the encoding to UTF-8 the euro symbol is correct

CandyEyes

Quote from: Veronica on November 25, 2012, 04:28:32 PM
Your page is set to be windows-1252 and when I change the encoding to UTF-8 the euro symbol is correct
I added this code to the template.html:
<meta http-equiv="Content-Type" content="text/html"; charset="utf-8">
and I selected the unicode (utf-8) on the configuration menu, and it's still not working....any clue?
thank you, Veronica for your hint.

Quote from: Phill Luckhurst on November 25, 2012, 04:21:14 PM
As far as I can see none of the changes you made to your them with cpmfetch would have affected the encoding. If it is fixed now I doubt we will ever know the cause. Good luck with your site, you've done a great job integrating the cpmfetch images to your theme.
the problem is still there, cause I repaired the wordpress database because of a problem with a server and the characters were wrong again...
thank you, Phill!

Veronica

Your page is still said to be windows-1252

Look at your .htaccess files for any encoding changes

Ask your web hosting about any web server encoding changes in Apache

CandyEyes

Quote from: Veronica on November 25, 2012, 04:51:45 PM
Your page is still said to be windows-1252

Look at your .htaccess files for any encoding changes

Ask your web hosting about any web server encoding changes in Apache
Got it! yay!...you were right, the template.html file didn't replace and I thought it had already....it was the mistake....I added the charset utf-8 and it worked.



Thank you for helping me, guys!

Veronica

Yes now it's right but the document type is also giving you some page errors

See this tool for the w3 results:
http://validator.w3.org/check?uri=http%3A%2F%2Fcandyeyes.es%2Fportfolio%2F

CandyEyes

Quote from: Veronica on November 25, 2012, 05:10:48 PM
Yes now it's right but the document type is also giving you some page errors

See this tool for the w3 results:
http://validator.w3.org/check?uri=http%3A%2F%2Fcandyeyes.es%2Fportfolio%2F
Thanks a lot, Veronica! I corrected some errors, the ones I understand... :)