Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Special Characters not showing after cpmfetch manipulation  (Read 4480 times)

0 Members and 1 Guest are viewing this topic.

CandyEyes

  • Coppermine novice
  • *
  • Country: es
  • Offline Offline
  • Gender: Female
  • Posts: 20
    • CandyEyesDeisgns
Special Characters not showing after cpmfetch manipulation
« on: November 24, 2012, 07:03:57 pm »

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.

Code: [Select]
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:
Code: [Select]
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.
Logged

Veronica

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: se
  • Offline Offline
  • Posts: 106
  • Coppermine 1.5.22
Logged

CandyEyes

  • Coppermine novice
  • *
  • Country: es
  • Offline Offline
  • Gender: Female
  • Posts: 20
    • CandyEyesDeisgns
Re: Special Characters not showing after cpmfetch manipulation
« Reply #2 on: November 25, 2012, 12:03:14 am »

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.
Logged

CandyEyes

  • Coppermine novice
  • *
  • Country: es
  • Offline Offline
  • Gender: Female
  • Posts: 20
    • CandyEyesDeisgns
Re: Special Characters not showing after cpmfetch manipulation
« Reply #3 on: November 25, 2012, 10:45:16 am »

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....
Logged

Phill Luckhurst

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4679
    • Windsurf.me
Re: Special Characters not showing after cpmfetch manipulation
« Reply #4 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.
Logged
It is a mistake to think you can solve any major problems just with potatoes.

Veronica

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: se
  • Offline Offline
  • Posts: 106
  • Coppermine 1.5.22
Re: Special Characters not showing after cpmfetch manipulation
« Reply #5 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
Logged

CandyEyes

  • Coppermine novice
  • *
  • Country: es
  • Offline Offline
  • Gender: Female
  • Posts: 20
    • CandyEyesDeisgns
Re: Special Characters not showing after cpmfetch manipulation
« Reply #6 on: November 25, 2012, 04:38:39 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:
Code: [Select]
<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.

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!
Logged

Veronica

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: se
  • Offline Offline
  • Posts: 106
  • Coppermine 1.5.22
Re: Special Characters not showing after cpmfetch manipulation
« Reply #7 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
Logged

CandyEyes

  • Coppermine novice
  • *
  • Country: es
  • Offline Offline
  • Gender: Female
  • Posts: 20
    • CandyEyesDeisgns
Re: Special Characters not showing after cpmfetch manipulation
« Reply #8 on: November 25, 2012, 05:02:39 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!
Logged

Veronica

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: se
  • Offline Offline
  • Posts: 106
  • Coppermine 1.5.22
Re: Special Characters not showing after cpmfetch manipulation
« Reply #9 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
Logged

CandyEyes

  • Coppermine novice
  • *
  • Country: es
  • Offline Offline
  • Gender: Female
  • Posts: 20
    • CandyEyesDeisgns
Re: Special Characters not showing after cpmfetch manipulation
« Reply #10 on: November 25, 2012, 05:46:47 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... :)
Logged
Pages: [1]   Go Up
 

Page created in 0.066 seconds with 21 queries.