Title: Character set problems.
Last modified: August 25, 2022

---

# Character set problems.

 *  Resolved [pvrtomg](https://wordpress.org/support/users/pvrtomg/)
 * (@pvrtomg)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/character-set-problems-3/)
 * 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](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcharacter-set-problems-3%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Temyk](https://wordpress.org/support/users/webtemyk/)
 * (@webtemyk)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/character-set-problems-3/#post-15952021)
 * 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](https://wordpress.org/support/users/pvrtomg/)
 * (@pvrtomg)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/character-set-problems-3/#post-15952182)
 * 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.
 *  [Temyk](https://wordpress.org/support/users/webtemyk/)
 * (@webtemyk)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/character-set-problems-3/#post-15952426)
 * Try using the wordpress loop and the_content() function
 *  Thread Starter [pvrtomg](https://wordpress.org/support/users/pvrtomg/)
 * (@pvrtomg)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/character-set-problems-3/#post-15953396)
 * 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](https://wordpress.org/support/users/pvrtomg/)
 * (@pvrtomg)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/character-set-problems-3/#post-15954553)
 * 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.

 * ![](https://ps.w.org/insert-php/assets/icon-256x256.gif?rev=3523853)
 * [Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts](https://wordpress.org/plugins/insert-php/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/insert-php/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/insert-php/)
 * [Active Topics](https://wordpress.org/support/plugin/insert-php/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/insert-php/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/insert-php/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [pvrtomg](https://wordpress.org/support/users/pvrtomg/)
 * Last activity: [3 years, 9 months ago](https://wordpress.org/support/topic/character-set-problems-3/#post-15954553)
 * Status: resolved