Baron Cohen 's other work includes voicing King Julien XIII in the Madagascar film series ( 2005-2012 ) and appearing in films such as Talladega Nights : The Ballad of Ricky Bobby ( 2006 ) , Sweeney Todd : The Demon Barber of Fleet Street ( 2007 ) , Hugo ( 2011 ) , and Les Misérables ( 2012 ) .