Make WordPress Core

Ticket #42: 0000042-latin2utf.php.txt

File 0000042-latin2utf.php.txt, 1.1 KB (added by Agent Orange, 20 years ago)
Line 
1<?php
2/*
3Plugin Name: Latin-2-UTF
4Plugin URI: http://kackreiz.net/wordpress.php
5Description: Since old versions of Wordpress used Latin-1 encoding for all the
6content, displaying these old entries through a new WP Version (using UTF-8)
7looks ugly. This Plugin converts the German Umlauts &Auml;...&uuml; and &szlig;
8from Latin1 to UTF8.
9
10Version: 1.0
11Author: Jan Varwig
12Author URI: http://kackreiz.net
13
14INSTALLATION:
151. Copy into wp-content/plugins and activate it in the admin-panel.
162. You can now use the filter latin2utf on any of your text-snippets
17   (like "the_content", "comment_text", etc.)More information on this can be
18   found here:
19                  http://wiki.wordpress.org/Plugin/API
20   For example you can put
21     add_filter('the_content', 'latin2utf');
22   on top of your index.php, after the
23     require('./wp-blog-header.php');
24   line
25*/
26
27        function latin2utf($string){
28                $search = array ('Ä','Ö','Ü','ä','ö','ü','ß');
29                $replace = array ('Ä','Ö','Ü','ä','ö','ü','ß');
30                $string = str_replace($search,$replace,$string);
31                return $string;
32        }
33?>