HTML symbols get question marks

jpaar / 2009-11-11 08:40:07   

Hello,

I decided to add HTML symbols to the exhibits on the page I am working on such as →
However when I re-edit the page, the & rarr; gets replaced by the actual arrow. Seems nice at first, but when I go look at the exhibit, it is replaced by a question mark.

I thought it might be part of the Process HTML option but it doesn't affect this issue.

Any ideas how I could work this out? It is too annoying to re-replace it every time an exhibit is edited. But also a too nice symbol to renounce it.

Thanks a lot

arsondpi / 2009-11-11 08:48:58   

...it may have to with the language encoding in your database.
Can you check if it's set on UTF-8?

jpaar / 2009-11-11 09:26:24   

Yes, it is set to de-utf-8. There are no problems with umlauts such as ä ö ü.

jpaar / 2009-11-11 09:29:49   

Do you think it is a MySQL issue or is there some kind of script running in indexhibit that replaces HTML symbol codes for the actual symbols?

But, when I enter the code for the symbol manually, everything is displayed fine. Problems occur when I re-edit the exhibit.

arsondpi / 2009-11-11 12:19:48   

I understand what you mean. I tried it in my server and it works fine over and over ... hmmm...

Vaska A / 2009-11-11 12:34:33   

Yeah, that seems to be a bit of a bug.

I'd recommend making a plugin that deal with that. Normally, something with an arrow implies something greater than simply text.

jpaar / 2009-11-11 18:48:23   

OK, I see. Do you have any hints how I could accomplish that, Vaska?

Thanks

Vaska A / 2009-11-11 19:02:17   

What's happening here is double encoding...I'm not completely sure how to solve that as it's realy a bit picky.

Maybe you could make a super simple plugin, and I know this sounds like a bit much, but it should work - something like this...

  1. function myArrow()
  2. {
  3.     return ‚Üí
  4. }

Then, on your page just called up with your text...

  1. <plug:myArrow />Subscribe to textbild RSS Feed

There is a basic tutorial about making plugins that will fill in the other details. Let us know if this works out for you...

Vaska A / 2009-11-11 19:03:00   

That arrow symbol was supposed to be the entity for it...you get the idea... ;)

jpaar / 2009-11-12 10:11:56   

Damn! It works perfectly. Thanks for guiding me there, Vaska!
In case somebody has the same problem: What I did exactly was save the file plugin.myArrow.php 
in the plugins folder. It looks like this:

  1. <?php 
  2. function myArrow
  3.     return '→'
  4. ?>

Of course instead of the actual arrow there is the HTML code for it:
& rarr; //remove space

In the exhibit I inserted:

  1. <plug:myArrow />

Vaska A / 2009-11-12 12:00:12   

Hey, that's great!

We've been known to have a couple good ideas around here sometimes.

;)

This thread has been closed, thank you.