[TYPO3-mvc] findBy[Property] ignores 'ö, ü, ä, etc'

chris Wolff chris at connye.com
Thu Apr 25 10:32:51 CEST 2013


hi Stanislaw,
you should make shure the whole system MySQL runs in UTF-8 and all charsets
and collations are set correctly.

i would not fix it in your controller because you should tackle the root of
your problem and not make "cosmetic" fixes on the top. this will hunt you!

check out whats wrong with your charset configurations or database
configurations.

regards chris



2013/4/25 Stanislaw Gutsch <stasmymaillists at gmail.com>

> Hello Adrien,
>
> after debugging for a bit I have to agree that your right. I do get symbols
> like "*ã¼*" for "ü" as a result out of my database and then try to search
> the database with those altered symbols again.
> Which obviously leads to findBy not finding "umlauts" properly for me.
>
> I do not know where the "conversion" happens though.
>
> My controller does following:
>
> $allEntires = $this->repository->findAll()->toArray();
>
> then fills a array with:
>
> foreach($allEntries as $entrie) {
>     array[$i] = $entrie->getName();
> }
>
> The getName() method looks like this:
> /**
>  * Returns the name
>  *
>  * @return string $name
>  */
> public function getName() {
> return $this->name;
> }
>
> at the end I use $repository->findByName(array);
>
> Could my getName() method do some conversions? In the database itself
> "umlauts" are stored properly though.
>
>
> 2013/4/25 Adrien Crivelli <adrien.crivelli at gmail.com>
>
> > This is a very wild guess, but could it be collation related ? If you are
> > not familiar with that, maybe have a look at:
> > https://dev.mysql.com/doc/refman/5.5/en/charset-general.html
> >
> >
> > On 25 April 2013 01:39, Stanislaw Gutsch <stasmymaillists at gmail.com>
> > wrote:
> >
> > > Hello everyone,
> > >
> > > first off all I´d like to mention that I'am rather new to Extbase and
> > Typo
> > > 3. While I'am getting used to it day by day I still sometimes run into
> > > problems where I just can't think off an solution. One of these
> problems
> > is
> > > that I have "umlauts" in an $repository->findBy[property]($operand) and
> > the
> > > findBy simply ignores entries with "umlauts".
> > >
> > > The "umlauts" are stored in a array like this:
> > > $names = array ( 0 => München
> > >                           1 => Lübek
> > >                           2 => Bonn
> > >                           3 => ......
> > >                          );
> > >
> > > The repository method call looks like this:
> > > $repository->findByName($names);
> > >
> > > Thx in advance!
> > > _______________________________________________
> > > TYPO3-project-typo3v4mvc mailing list
> > > TYPO3-project-typo3v4mvc at lists.typo3.org
> > >
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
> > >
> > _______________________________________________
> > TYPO3-project-typo3v4mvc mailing list
> > TYPO3-project-typo3v4mvc at lists.typo3.org
> > http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
> >
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
>



-- 
christian wolff - webdeveloper, tech-loving geek and typo3 enthusiast
telefon: +49 30 347 244 88
mobil:  +49 179 49 44 758
email: chris at connye.com
adresse: friedelstraße 31 - 12047 berlin

xing-profil: http://www.xing.com/profile/Christian_Wolff43
google+: https://plus.google.com/u/0/115669673917212236875/posts?hl=de
facebook: https://www.facebook.com/1stMachine
flattr: https://flattr.com/profile/1stmachine


More information about the TYPO3-project-typo3v4mvc mailing list