Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Zamiana ISO z maila na normalny test, =?ISO-8859-2?Q?
atay
post
Post #1





Grupa: Zarejestrowani
Postów: 58
Pomógł: 0
Dołączył: 8.10.2003

Ostrzeżenie: (0%)
-----


mam skrypt ktory laczy sie ze skrzynka i sciaga listy.
I niektore sa kodowane w iso-8859-2, co jest raczej normalne.

Jednak potrzebuje miec z tego zwykly tekst, mam np.
Cytat
=?ISO-8859-2?Q?Wygra=B3e=B6=20?= =?ISO-8859-2?Q?aukcj=EA:?=
co oczywiscie brzmi "Wygrałeś aukcję".

Czy jest jakas gotowa procedura wywalajaca te wszystkie znaczki czy musze ja sam napisac ?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
darecki
post
Post #2





Grupa: Zarejestrowani
Postów: 54
Pomógł: 2
Dołączył: 24.08.2005
Skąd: Warszawa

Ostrzeżenie: (0%)
-----


kiedys pisałem co podobnego i gdzies znalazlem na foruch taka funkcje i generalnie działa:

  1. <?php
  2.  
  3. function Dekodowanie($subject)
  4. {
  5.  $string = $subject;
  6.  if(($pos = strpos($string,"=?")) === false) return $string;
  7.  while(!($pos === false))
  8.  {
  9. $newresult .= substr($string,0,$pos);
  10. $string = substr($string,$pos+2,strlen($string));
  11. $intpos = strpos($string,"?");
  12. $charset = substr($string,0,$intpos);
  13. $enctype = strtolower(substr($string,$intpos+1,1));
  14. $string = substr($string,$intpos+3,strlen($string));
  15. $endpos = strpos($string,"?=");
  16. $mystring = substr($string,0,$endpos);
  17. $string = substr($string,$endpos+2,strlen($string));
  18. if($enctype == "q") $mystring = quoted_printable_decode(ereg_replace("_"," ",$mystring));
  19. else if ($enctype == "b") $mystring = base64_decode($mystring);
  20. $newresult .= $mystring;
  21. $pos = strpos($string,"=?");
  22.  }
  23.  $result = $newresult.$string;
  24.  if(ereg("koi8", $subject)) $result = convert_cyr_string($result, "k", "w");
  25.  return $result;
  26. }
  27.  
  28. ?>
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 5.10.2025 - 13:23