Index: wp-trackback.php
===================================================================
--- wp-trackback.php	(revision 4164)
+++ wp-trackback.php	(working copy)
@@ -30,6 +30,12 @@
 	$tb_id = intval( $tb_id[ count($tb_id) - 1 ] );
 }
 
+if ( is_single() || is_page() )
+    $tb_id = $posts[0]->ID;
+
+if ( !intval( $tb_id ) )
+	trackback_response(1, 'I really need an ID for this to work.');
+
 $tb_url    = $_POST['url'];
 $title     = $_POST['title'];
 $excerpt   = $_POST['excerpt'];
@@ -41,18 +47,14 @@
 else
 	$charset = 'ASCII, UTF-8, ISO-8859-1, JIS, EUC-JP, SJIS';
 
+$charset = apply_filters('trackback_charset', $charset);
+
 if ( function_exists('mb_convert_encoding') ) { // For international trackbacks
 	$title     = mb_convert_encoding($title, get_option('blog_charset'), $charset);
 	$excerpt   = mb_convert_encoding($excerpt, get_option('blog_charset'), $charset);
 	$blog_name = mb_convert_encoding($blog_name, get_option('blog_charset'), $charset);
 }
 
-if ( is_single() || is_page() ) 
-    $tb_id = $posts[0]->ID;
-
-if ( !intval( $tb_id ) )
-	trackback_response(1, 'I really need an ID for this to work.');
-
 if (empty($title) && empty($tb_url) && empty($blog_name)) {
 	// If it doesn't look like a trackback at all...
 	wp_redirect(get_permalink($tb_id));

