Recent Topics

1 Jun 23, 2008 22:55    

When using the bookmarklet, some unicode characters are not converted good and are displayed as %u20AC instead of € in the edit window.

I implemented a very dirty quick fix that handles most for my cases, but I am looking for a more generic fix to handle unicode chars better. For the moment I changed the following code in _item_expert.form.php from


	// ---------------------------- TEXTAREA -------------------------------------
	$Form->fieldstart = '<div class="edit_area">';
	$Form->fieldend = "</div>\n";
	$Form->textarea_input( 'content', $item_content, 16, '', array( 'cols' => 40 , 'id' => 'itemform_post_content' ) );
	$Form->fieldstart = '<div class="tile">';
	$Form->fieldend = '</div>';


to


	// ---------------------------- TEXTAREA -------------------------------------
	$Form->fieldstart = '<div class="edit_area">';
	$Form->fieldend = "</div>\n";
	if( $creating ) {
    	$item_content = str_replace('%u20AC','€',$item_content);
    	$item_content = str_replace('%u201A',',',$item_content);
    	$item_content = str_replace('%u201C','“',$item_content);
    	$item_content = str_replace('%u201D','”',$item_content);
    	$item_content = str_replace('%u201E','„',$item_content);
    	$item_content = str_replace('%u2018','‘',$item_content);
    	$item_content = str_replace('%u2019','’',$item_content);
    	
	}
	else {
	}
	$Form->textarea_input( 'content', $item_content, 16, '', array( 'cols' => 40 , 'id' => 'itemform_post_content' ) );
	$Form->fieldstart = '<div class="tile">';
	$Form->fieldend = '</div>';

As you can see, not the best code there is, but I couldn't figure out the correct solution. So any help would be appreciated.

2 Dec 03, 2008 14:57

Is there already a solution available for this bug? In 2.4.5 it's still present.


Form is loading...