8

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

Gripsiden
  • 467
  • 2
  • 15
  • 1
    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. – Skuli Axelson Dec 28 '12 at 18:24
  • Depending on the version of PHP you're using, you might run into character encoding issues (http://stackoverflow.com/questions/571694/what-factors-make-php-unicode-incompatible). – James Kingsbery Dec 28 '12 at 18:29
  • @Skuli: That's almost certainly the issue: YouTube is expecting a UTF-8 string, but the OP's code is saved in some other charset (most likely ISO Latin 1 or Windows-1252). You might want to post your comment as an answer. – Ilmari Karonen Dec 28 '12 at 18:54

2 Answers2

3

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.

Community
  • 1
  • 1
Skuli Axelson
  • 534
  • 1
  • 8
  • 17
  • Hi ,Im entering directly in Dreamweaver. I actually noticed that PSPAD ( editor i use ) was set to ANSI so changed to UTF8 and retried( copied into PSPAD , then to Dreamweaver ) but this didnt work.Thanks though :) – Gripsiden Dec 28 '12 at 21:04
1

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';

Les Mac
  • 23
  • 2