| using select_country() in ia0-8859-1 documents [message #7752] |
Thu, 22 June 2006 13:00  |
hautzi Messages: 21 Registered: April 2006 Location: Heilbronn, Germany |
Junior Member |
|
|
hello,
i'm using the select_country() function to get a list of all countries - but german 'umlaute' like 'äöü' aren't displayed correctly.
i've tried to change the enconding of the .dat file containing the information in <pear-path>/data/symfony/i18n/ but it also didn't work.
is there a solution for that?
greetrings
christoph hautzinger
http://diginights.com
|
|
|
|
|
| Re: using select_country() in ia0-8859-1 documents [message #15915 is a reply to message #7752 ] |
Tue, 14 November 2006 15:53   |
halfer Messages: 9535 Registered: January 2006 Location: West Midlands, UK |
Faithful Member |
|
|
I am not familiar with the problem, but it looks like select_country_tag could be rewritten to use a multi-byte-aware sort routine.
Remember Palestine
|
|
|
|
| Re: using select_country() in ia0-8859-1 documents [message #15923 is a reply to message #7752 ] |
Tue, 14 November 2006 17:29   |
halfer Messages: 9535 Registered: January 2006 Location: West Midlands, UK |
Faithful Member |
|
|
Yes, but if I understand simonbun's message correctly, it is asort that is corrupting the special characters.
Remember Palestine
|
|
|
| Re: using select_country() in ia0-8859-1 documents [message #15926 is a reply to message #15923 ] |
Tue, 14 November 2006 17:37   |
aleckan Messages: 43 Registered: March 2006 Location: sweden |
Member |
|
|
| halfer wrote on Tue, 14 November 2006 17:29 | Yes, but if I understand simonbun's message correctly, it is asort that is corrupting the special characters.
|
nope, I have tried to remove the sorting and the result is the same with the corrupt characters
[Updated on: Tue, 14 November 2006 17:38] best regards
alexander engvall
http://blog.trans4m.se
|
|
|
| Re: using select_country() in ia0-8859-1 documents [message #15927 is a reply to message #7752 ] |
Tue, 14 November 2006 17:45   |
halfer Messages: 9535 Registered: January 2006 Location: West Midlands, UK |
Faithful Member |
|
|
Internationalisation isn't my bag, but have you tried utf-8?
Remember Palestine
|
|
|
|
| Re: using select_country() in ia0-8859-1 documents [message #15931 is a reply to message #7752 ] |
Tue, 14 November 2006 18:30   |
halfer Messages: 9535 Registered: January 2006 Location: West Midlands, UK |
Faithful Member |
|
|
Oh dear. How about writing a helper that switches special characters to entity equivalents before putting them into the select tag helper?
Remember Palestine
|
|
|
|
| Re: using select_country() in ia0-8859-1 documents [message #15943 is a reply to message #7752 ] |
Tue, 14 November 2006 23:20   |
halfer Messages: 9535 Registered: January 2006 Location: West Midlands, UK |
Faithful Member |
|
|
It does it in PEAR/symfony/helper/FormHelper.php. Try this:
<?php $c = new sfCultureInfo(sfContext::getInstance()->getUser()->getCulture());
$countries = $c->getCountries();
echo "<pre>";
print_r($countries);
echo "</pre>"; ?>
If that doesn't produce a corrupt array, then the issue would have to be in select_country_tag().
Remember Palestine
|
|
|
| Re: using select_country() in ia0-8859-1 documents [message #15946 is a reply to message #15943 ] |
Wed, 15 November 2006 00:23   |
aleckan Messages: 43 Registered: March 2006 Location: sweden |
Member |
|
|
that code produces the same error. example:
[AE] => Förenade Arabemiraten
if I use utf-8 the problem is gone, but then I can't have åäö caharcters posted properly in input tags instead which is even worse.
the question is if the characters are read wrong from the file, and if so if I can change the chartype of the dat file? why aren't the special charcters writen as entitys in the dat file from the beginning?
[Updated on: Wed, 15 November 2006 00:24] best regards
alexander engvall
http://blog.trans4m.se
|
|
|
|
|
|
| Re: using select_country() in ia0-8859-1 documents [message #15956 is a reply to message #15954 ] |
Wed, 15 November 2006 10:06  |
aleckan Messages: 43 Registered: March 2006 Location: sweden |
Member |
|
|
| chtito wrote on Wed, 15 November 2006 09:49 | How come you didn't find a solution? As i said there are loads of web sites using input tags and utf-8 and nobody has problem with that. At least people should be able to help you out. What is your problem with input tags? Did you ask about that in this forum before?
|
The problem is sort of the same but reversed, when I use utf-8 the $this->getRequestParameter('name_of_field') is corrupt with strange characters instead of the åäöéü etc that should be there. So I don't even have a chance to replace them with html entitys before I save the posted info in the database.
I don't remember if I asked about this earlier as I found the solution in using iso8859-1 instead, and that have worked perfect untill now with the problems using select_country_tag
best regards
alexander engvall
http://blog.trans4m.se
|
|
|