Posts: 51
Threads: 6
Joined: Jun 2011
Hi!
Can somebody tell me if GS3.1 will end problem with entities?
Im from Poland, and have problem with SEO, because every Ó is represented as ó
It's problem, when You live in Jelenia Góra
This problem affects, keywords, description, content, title.
I've deal with it by making custom /admin/inc/theme_functions.php
I added
$myVar = html_entity_decode($myVar, ENT_QUOTES, "UTF-8");
almost everywhere, but this is undoing things that could be not done in first place.
Why change characters to entites when xml file is allready saved as UTF-8 ?
If this problem is allready fixed close this toppic, if not ? Im commiting official bug.
BR
Grzegorz
Posts: 2,928
Threads: 195
Joined: Feb 2011
which locale / codepage did you define in gsconfig.php`?
Posts: 51
Threads: 6
Joined: Jun 2011
2011-09-29, 18:22:52
(This post was last modified: 2011-09-29, 18:28:33 by tonyness.)
Connie Wrote:which locale / codepage did you define in gsconfig.php`? I can not be more stupid than I am.
I didn't define any.
now i've set
setlocale(LC_ALL, 'pl_PL');
and still have entites problem.. Only working solution is this, what I wrote earlier
Posts: 2,928
Threads: 195
Joined: Feb 2011
So I guess it is solved now?
Please be aware, that this codepage-problems are not related to intelligence ;=)
they just happen!
Cheers, Connie
Posts: 51
Threads: 6
Joined: Jun 2011
Connie Wrote:So I guess it is solved now? We wrote at same time.
this didn't work.
Posts: 423
Threads: 15
Joined: Mar 2011
To use utf-8 (and avoid html entities for normal text) throughout, it is necessary to set the editor options and change the safe_slash_html() function as mentioned in this post.
--
Nick.
Posts: 51
Threads: 6
Joined: Jun 2011
hameau Wrote:To use utf-8 (and avoid html entities for normal text) throughout, it is necessary to set the editor options and change the safe_slash_html() function as mentioned in this post.
I've done it... but this don't work with keywords and description. I think its a solution for page content only.
function get_page_meta_keywords($echo=true) {
global $metak;
$myVar = strip_decode($metak);
$myVar = html_entity_decode($myVar, ENT_QUOTES, "UTF-8");
if ($echo) {
echo $myVar;
} else {
return $myVar;
}
}
I've add bolded line in every get_page_XXX function in theme_functions.php that seems to work.
Posts: 423
Threads: 15
Joined: Mar 2011
grs84pl Wrote:... but this don't work with keywords and description. It works for me in page content, tags, description and menu text. Including Jelenia Góra. ;^ All code at the browser is utf-8 encoded, with no entities in the text.
Perhaps a plug-in is affecting your results? Or a cache somewhere?
--
Nick.
Posts: 88
Threads: 9
Joined: Feb 2011
grs84pl Wrote:Hi!
Can somebody tell me if GS3.1 will end problem with entities?
Im from Poland, and have problem with SEO, (...) hameau Wrote:It works for me in page content, tags, description and menu text. Do you have this problem already with 3.0? I have 3.0 and ó renders correctly in <title> only. In <meta> and in content it outputs as ó contrary to what hameau says. I also consider it as a bug - if <title> can be printed correctly, why not other fields from page options?
Posts: 423
Threads: 15
Joined: Mar 2011
okay, I have checked with two servers. One of them shows no html entities, but the other one has the same symptoms that you describe, with all non-ascii characters (as well as html special characters) transformed.
I don't know the solution, but I guess it must be a server setting somewhere.
--
Nick.
Posts: 51
Threads: 6
Joined: Jun 2011
hameau Wrote:okay, I have checked with two servers. One of them shows no html entities, but the other one has the same symptoms that you describe, with all non-ascii characters (as well as html special characters) transformed.
I don't know the solution, but I guess it must be a server setting somewhere.
Solution is html_entity_decode, is it too much if I ask, that this will be implented in GS3.1 ?
BR
Grzegorz
Posts: 2,094
Threads: 54
Joined: Jan 2011
grs84pl Wrote:Solution is html_entity_decode, is it too much if I ask, that this will be implented in GS3.1 ?
BR
Grzegorz
I doubt that this is the solution. It would also decode <, >, & in the text, which it must not do!
Posts: 88
Threads: 9
Joined: Feb 2011
hameau Wrote:the same symptoms that you describe, with all non-ascii characters (as well as html special characters) transformed. If the cause is server PHP setting and <title> is resistant to these settings, is it because <meta> and all the rest is proceeded with different PHP process than <title>?
Posts: 51
Threads: 6
Joined: Jun 2011
mvlcek Wrote:I doubt that this is the solution. It would also decode <, >, & in the text, which it must not do! I think it is... Got it on my sites, it decode only entities.
I made it like this (theme_functions.php line ~290) :
Code: echo '<meta name="description" content="'.html_entity_decode(encode_quotes($description), ENT_QUOTES, "UTF-8").'" />'."\n";
Now I got no problem with entities.
Posts: 6,266
Threads: 181
Joined: Sep 2011
|