Home » Php » php – Black Diamond Questions Marks – Youtube API – J�r�my

php – Black Diamond Questions Marks – Youtube API – J�r�my

Posted by: admin July 12, 2020 Leave a comment

Questions:

when I try send the following to Youtube Description via API – for example: Jérémy – I get J�r�my in the youtube description. Strangely , "–" also shows as "�".

Im posting with PHP Zend API :

$myVideoEntry->setVideoDescription('Jérémy');

Im not sure if I can set encoding? When I change the description manually it works fine.

ANSWER – Changed Page Properties in Dreamweaver to UTF8 and problem solved. Thanks all

How to&Answers:

What editor are you using when you write your code? I once had this issue an discovered that in Notepad++ the page encoding was set to ANSI and not UTF8 as I needed.

This could also be an duplicate from:   not being displayed properly. Check out the answer from GmonC to that post.

Answer:

Not 100% sure but as you are sending a string it might mean you will need to use the ascii code for “special” characters as they will be evaluated as is when rendered by the browser.

for example for é you could use:

$myVideoEntry->setVideoDescription('Jérémy');

and for a dash you could/would use: ‘&#45’;