CaRP Evolution Documentation
CaRP Evolution Documentation
twitter youtube linkedin google-plus
CaRP Evolution Box
Web This Site

CaRP: Caching RSS Parser - Documentation

CaRP Interactive FAQ
Getting Started: Free Download | Purchase | Install
Reference: Functions | Plugins | Themes | Full Index
Etc.: Display Formatting | Example Code | Affiliates


XML character encoding converter utility
GPL Koi Evolution
n/a 3.5.7 - 3.5.11 3.5.7 - 3.5.11
As of version 3.6, Transcode's functionality has been integrated into CaRP Koi and CaRP Evolution. Transcode is a PHP script (transcode.php) that converts XML documents from one encoding to another. It is useful for processing XML documents in PHP scripts when the "charset" of the source document is not one of the encodings supported by PHP's built-in XML parser (UTF-8, ISO-8859-1 and US-ASCII). Transcode is bundled with CaRP Koi and CaRP Evolution.

Transcode requires iconv support, and support for opening remote files using PHP's "fopen" function. To find out whether Transcode will work on your server, upload it to your server and then load the following URL in your web browser, substituting your domain name and the path to your copy of transcode.php in at the beginning of the URL:

If you see an error message about the fopen function failing or iconv being an unknown function, then your server does not support Transcode.

If you wish to limit the IP addresses from which Transcode may be executed (for example, to only allow your own server to use it so that random people don't use up your bandwidth converting their own documents), find this line near the top of transcode.php:


List any IP addresses which you wish to allow into the array. Two examples follow:

only allow one IP address:

allow any of the specified IP addresses:

After configuring Transcode, simply upload it to your webserver.

Use: To convert a document, load transcode.php from your webserver, with the URL of the feed you want to convert specified like this (Note that for security purposes, Transcode will refuse to process local files--the URL must begin with http:// or https://. "https" URLs are not supported by all servers):

By default, Transcode converts to the UTF-8 character set (which is the default encoding for XML documents). You can change this behavior by specifying the target encoding like this:

If the document doesn't specify it's character set in the XML prologue (the first line of an XML document), you'll need to find out what it is and add it to the URL like this:

Usage Example with CaRP:
Notice how the URL of the feed is placed inside a call to "urlencode". This ensures that the "&" in the feed URL is properly encoded. Otherwise, Transcode would think that the URL of the feed was "", and that "items=15" was one of Transcode's own settings.

Also notice that CaRP has been told to output UTF-8. This is usually necessary if the source feed contains characters that aren't used in English, because CaRP's default output encoding (ISO-8859-1 -- which is PHP's default encoding) only contains letters and symbols used in English.
require_once '/home/geckotribe/carp/carp.php';