The center for all Wikitravel images!

Tech:ListingEditor cannot handle the value of name field in non-ASCII characters

From Wikitravel Shared
Jump to: navigation, search

What happens[edit]

If I put "Замок Святого Ангела", Castel Sant' Angelo in Russian, into name filed of listing editor, url of "edit" link become http://wikitravel.org/shared/Tech:ListingEditor_cannot_handle_the_value_of_name_field_in_non-ASCII_characters#__.

  • Замок Святого Ангела.  edit

If I put "香港君悅酒店", Grand Hyatt Hong Kong in Chinese, into name filed of listing editor, "edit" link doesn't come up.

  • 香港君悅酒店.

When it happens[edit]

These problems always occur when non-ASCII characters are put into name filed.

What should happen[edit]

In both cases, "edit" link should come up with properly encoded url.

How to fix it[edit]

Before set id attribute and url of "edit" link, encode the value of name field by the same way of MediaWiki's "anchorencode" colon function. (source code of MediaWiki 1.15.0, the first implementation)


	static function anchorencode( $parser, $text ) {
		$a = urlencode( $text );
		$a = strtr( $a, array( '%' => '.', '+' => '_' ) );
		# leave colons alone, however
		$a = str_replace( '.3A', ':', $a );
		return $a;
	}

Additional comments[edit]

I'd love to use ListingEditor on Chinese version of Wikitravel. This and non-ASCII characters in the "alt" field are big problem to use ListingEditor on that language version.

We are hoping this will be fixed with the next upgrade. Ibsteph 04;49 pm, 18 February 2010 (EDT)
We now have an update. Is the problem still there, or can we close the ticket? Riggwelter 16:46, 20 June 2012 (EDT)
Problem is still here, as evident from the broken listing at the top of this page! --Peter Talk 21:58, 20 June 2012 (EDT)
Seems to work now for the Cyrillic characters, but not for the Chinese. -- D. Guillaime 22:20, 10 July 2012 (EDT)

Sign below, please[edit]

-- Tatata 07:33, 15 June 2009 (EDT)

Variants

Actions

In other languages