Connecting Tech Pros Worldwide Help | Site Map

error while encoding a txt file to win-1252

Paula Blau
Guest
 
Posts: n/a
#1: Jul 17 '05
Hi there,

I have a problem with encoding a file .txt to win-1252.

$text = recode_string("ISO-8859-1..win-1252", $text);

but I get the following error message:

Fatal error: Call to undefined function: recode_string()

the same when I trie to recode the whole file

with recode_file.

Perhaps wrong Parameters ?
but wwhich instead ?
or sombody who knows another solution.
Will be glad about every hint and hope the question is not to silly for this
group,

greetings, Paula


Pedro Graca
Guest
 
Posts: n/a
#2: Jul 17 '05

re: error while encoding a txt file to win-1252


Paula Blau wrote:[color=blue]
> I have a problem with encoding a file .txt to win-1252.
>
> $text = recode_string("ISO-8859-1..win-1252", $text);
>
> but I get the following error message:
>
> Fatal error: Call to undefined function: recode_string()[/color]

Recode Functions are not available on Windows platforms
http://www.php.net/manual/en/ref.recode.php
[color=blue]
> the same when I trie to recode the whole file
>
> with recode_file.
>
> Perhaps wrong Parameters ?
> but wwhich instead ?
> or sombody who knows another solution.[/color]

Maybe iconv() will do what you want?
http://www.php.net/manual/en/function.iconv.php


Something like (not tested, never used iconv())

$text = iconv('ISO-8859-1', 'win-1252', $text);
--
USENET would be a better place if everybody read: : mail address :
http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
http://www.expita.com/nomime.html : to 10K bytes :
Closed Thread