3

How can i convert this

$langClarContent = > &# 1059.,&#1095.,&#1080.,&# 1090.,&# 1077.,&# 1083.,Dokeos &# 1077., &# 1089.,&# 1080.,&# 1089.,&# 1090.,&# 1077.,&# 1084., &# 1079.,&# 1072., &# 1091.,&# 1087.,&# 1088.,&# 1072.,&# 1074.,&# 1091.,&# 1074.,&# 1072.,&# 1114.,&#1077., &# 1089.,&#1086., &# 1091.,&# 1095.,&# 1077.,&# 1114.,&# 1077., &# 1080., &# 1079.,&# 1085.,&# 1072.,&#1077.,&# 1114.,&# 1077.,. &# 1058.,&# 1086.,&# 1112., &# 1080.,&#1084., &# 1076.,&# 1086.,&# 1087.,&# 1091.,&# 1096.,&# 1090.,&# 1072., &# 1085.,&# 1072., &#1091.,&# 1095

to an utf related answer like

$langClarContent = Учител Dokeos е систем за управување со учење и знаење. Тој им допушта на у&#1095

Darwly
  • 344
  • 1
  • 6
  • 22
  • 1
    Are you working in PHP (I'm guessing by the `$`)? If not, what language or framework are you using? – Seth Mar 10 '10 at 01:50
  • Well yea i am using php, but the language doesent matter ill use every langugae that does the bidding, i have a file with loads of HTML codes i want them in utf. I like the answer below, i'll just write a script doing for all files and for all codes and it should work, the only problem is where can i find the codes to utf equivalent list. – Darwly Mar 10 '10 at 12:30

2 Answers2

3

Note.. Htmlspecialchar only converts some of the characters.. if you want to convert all characters use: html_entity_decode

http://th.php.net/manual/en/function.html-entity-decode.php

Alfred
  • 21,058
  • 61
  • 167
  • 249
Chris
  • 8,168
  • 8
  • 36
  • 51
0

Once you have that array properly formatted you can do something like this in PHP:

foreach ($langClarContent as $char){
echo htmlspecialchars_decode($char);
}
ssergei
  • 1,289
  • 9
  • 21
  • Thanks, this helps a lot, didnt solved my problem fully, but helps enough to solve it :D. Thanks a lot. i have a file full of htmlcodes, i wish to create the same file but with the utf twins inside it... – Darwly Mar 11 '10 at 12:18