• Resolved pvrtomg

    (@pvrtomg)


    I am developing a some php snippets for use on our wordpress site. The problem I’m encountering is withthe display of some characters. fors example the UK Pound sign. it is appearing as Black Diamond witha question mark.

    If I view a post using the permalink it looks just fine.

    If I view the post via a php snippet I get the problem.

    In the snippet I just retrive the post of the database then do :-

    print $row[‘post_content’];

    Now I guess that there is a bit of code in wordpress that is fixing the problem for the reguar display of a post. I had a hunt though the TPG Get Post pugin for some clue as it’s almost dong what I want to do in my snippet.

    If I cut and paste the bad character then pump it though od I get this.

    [tomg@www ]# echo Cost:    �594 |od -x
    0000000 6f43 7473 203a bfef 35bd 3439 000a
    0000015
    [tomg@www ]# echo Cost:    £594 | od -x
    0000000 6f43 7473 203a a3c2 3935 0a34
    0000014

    can anyone suggest where I’m going wrong.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Temyk

    (@webtemyk)

    Hello.

    This question does not apply to the Woody plugin. This is a PHP question. The problem is in your snippet code

    Thread Starter pvrtomg

    (@pvrtomg)

    Hi Trmyk,

    Yes I can seethat I have been doing more inverstigation and have found I can reproduce the problem ouside of Woody snippets. What is really bizarre is that if in the same snippet I code :-

    print “Test the UKP charter £<br />”;

    That prints the ‘£’ correctly,

    Looking at the data in the $row[‘post_content’] character is 0xa3 so I’m stuck not kowing where to look for a solution.

    Plugin Support Temyk

    (@webtemyk)

    Try using the wordpress loop and the_content() function

    Thread Starter pvrtomg

    (@pvrtomg)

    I’m obviously doing something very wrong that function causes an out of memory problem. I need to read me documentation. Thatks for you help.

    Thread Starter pvrtomg

    (@pvrtomg)

    Temyk Thank you for your help. It’s amazing what a bit of RTFM will do. Once I realiased you don’t have to pull post out of the database yourself but can do it with WP_Query all of my problems went away.

    Thank You Again.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Character set problems.’ is closed to new replies.