Jump to content


[problem]character Encoding Errors


8 replies to this topic

#1 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 14 April 2006 - 11:38 AM

This issue, from the old Etogal support thread, has been added to the buglist

churchyard said:

... I have an other problem: coding (names of galleries)
ř -> crossed o (this is normally made because of cp1250/win coding instead of iso-8859-2)
but in the code is "& oslash ;" (without spaces).
I think some code makes from ěÅ¡čřžýáíé &xyz; - and it uses wrong coding.
What to do?
Thank you!
The names get pushed throuh htmlentities prior to display.

My guess is that the PHP htmlentities function is assuming a specific character encoding which is different to the one churchyard is using. I'll look into adding an option for setting charset in the relevant calls in the next release, but there are two issues:
1) I can't easily test it ...
2) I'll need to check which versions of PHP support it, and what happens when used with versions that don't.

#2 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 12 May 2006 - 10:41 PM

OK, I need some help here - I have a test version of etogal (attached) which will accept an additional snippet parameter (charset) and if presented will be passed on the htmlentities call (so you'd add charset=UTF-8 or charset=cp1252 or whatever supported charset you need)

I can't test it here as I don't use any languages that need it, so I'd be grateful if anyone affected could try it in place of the EtoGal beta in the download area (there's one other very minor bugfix in there, that only affects the output from display=childgalleries.

Its attached to this post if you want to try it.

Attached Files



#3 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 30 May 2006 - 10:28 AM

In the absence of any response, I can only conclude that this fix is of no interest to anyone, so it won't be included in the Etogal 1.2 package.

#4 Jim Browski

    Likes Etomite Forums!

  • Member
  • PipPip
  • 163 posts

Posted 30 May 2006 - 11:30 AM

View Postmikef, on May 30 2006, 12:28 PM, said:

In the absence of any response, I can only conclude that this fix is of no interest to anyone, so it won't be included in the Etogal 1.2 package.

Hi,
i don't use EtoGal at the moment but i think i will do so in future. So I would be very interested in a feature to support - for example - German Umlauts, but i'm not sure if this is what your "charset"-feature is all about. Is it?

JB

#5 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 30 May 2006 - 11:48 AM

View PostJim Browski, on May 30 2006, 12:30 PM, said:

Hi,
i don't use EtoGal at the moment but i think i will do so in future. So I would be very interested in a feature to support - for example - German Umlauts, but i'm not sure if this is what your "charset"-feature is all about. Is it?

JB
yes, thats what its for. At present EtoGal assumes you are using PHP's default character set which is, of course, suited to English. This caused churchyard some problems (czech uses quite a few non-English characters!) and he patched his copy to not use the PHP functions that caused the problem. I didn't think this was the best approach so this is an attempt to allow the use of one of the other character sets supported by PHP (particularly the htmlentities function).

#6 churchyard

    Etomite Forum Fan

  • Member
  • Pip
  • 65 posts

Posted 15 November 2006 - 06:38 AM

If I want this to get work i need to set $gcharset by my hand? or it is taken from DB?
It is not working... (showing the same)

#7 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 15 November 2006 - 11:41 AM

having looked at the code, if you are using the version of EtoGal in this thread you should call it with the charset specified in the snippet call (as charset=xxxxxxx not gcharset=...) The charset specified must be supported by your version of PHP, and be named the way PHP expects it to be named.

If it doesn't work, can you give me a link to a page where it isn't working, please.

#8 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 15 November 2006 - 12:13 PM

Also, if it doesn't work, you might like to try replacing
return @htmlentities($source, $qs, $gcharset);
with
return htmlentities($source, $qs, $gcharset);
on about line 94

This may then give a useful error messge.

#9 churchyard

    Etomite Forum Fan

  • Member
  • Pip
  • 65 posts

Posted 16 November 2006 - 07:18 AM

added
$charset = 'iso-88592';
and it is not working

Edited by churchyard, 16 November 2006 - 07:22 AM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users