[FX.php List] Foreign characters in CWP request

Dennis Crall dennis-crall at uiowa.edu
Mon Oct 10 09:06:47 MDT 2005


Ok, I finally figured this out, and as usual the problem was mine -- not
FileMaker's. I'm still trying to understand exactly what was happening, but
basically my search string was not a unicode string. I wrapped the search
parameter in PHP's utf8_encode() function, and the problem was solved. Like
so:

$fx->AddDBParam( $key, utf8_encode( $value ), "eq" );

I'm still a little confused as to the source of the problem. Here are my
theories:

1.) As you may remember, I was retrieving a list of search values from a
static value list. I assumed FileMaker stores value lists as unicode and
therefore the list values would match the values in the field. Is that
correct? 

2.) My php and html template files were not saved as unicode documents. When
I originally built the site, php would output some random gremlins at the
top of the page when the file was utf encoded. I seem to be able to save the
files as UTF documents now without producing gemlins, but with no effect on
the search issue. Maybe the gremlins were a Smarty bug?

In general, do you save your FX scripts encoded as unicode data? How about
Smarty templates?

Thanks for listening. I hope this helps someone in the future.

Denny Crall



On 10/8/05 5:45 AM, "Gjermund Gusland Thorsen" <ggt667 at gmail.com> wrote:

> Did you change the FX.php file? and the the grammar variable to match
> 7 instead of 5/6?
> 
> Do not expect related data to travel through related files, only
> related tables in the same file works, at least for me.
> 
> Gjermund
> 
> On 10/4/05, Dennis Crall <dennis-crall at uiowa.edu> wrote:
>> Hi,
>> 
>> I posted this last week, but I've documented the problem in more detail. I'm
>> hoping someone can at least comment on the level of "Yeah, we're doing that
>> and it should work" or "We've seen this problem also." Any input is
>> appreciated.
>> 
>> Thanks for your time,
>> 
>> Dennis Crall
>> ITS-Academic Technologies
>> The University of Iowa
>> http://at.its.uiowa.edu
>> 
>> -------------------------------------------------------
>> 
>> Background:
>> We have a FileMaker 6 custom web publishing solution that needs to be
>> migrated to FileMaker 7. CWP requests are generated from FX.php. The
>> solution is in English but deals with archaeological artifacts from Spain
>> and Portugal. As a result, the site includes many names that contain foreign
>> characters.
>> 
>> Use case:
>> The user can browse the site based on the museums, which house the
>> artifacts. The web site generates a list of museums from a fixed value list.
>> Each museum name is a link, which should perform a simple find query for the
>> plaques housed in that museum.
>> 
>> Problem:
>> The search does not work in FileMaker 7 when the museum name includes
>> foreign characters. The search operates normally if the museum name contains
>> no characters that need to be url encoded. The search operates normally from
>> the FileMaker 7 client interface. This behavior is consistent with other
>> fields containing similar values.
>> 
>> CWP Request Details:
>> 
>> FM6, FM7 PHP request:
>> search.php?museum=Associa%E7%E3o%20Local%20de%20Arte%20e%20Arqueologia%20de%
>> 20Rio%20de%20Moinhos,%20Portugal
>> 
>> search.php?museum=Associa%E7%E3o%20Local%20de%20Arte%20e%20Arqueologia%20de%
>> 20Rio%20de%20Moinhos,%20Portugal
>> 
>> 
>> The FM7 CWP request returns an error code of -1:
>> http://fm7/fmi/xml/FMPXMLRESULT.xml?-db=esprit&-lay=web_search&Location=Asso
>> cia%E7%E3o%20Local%20de%20Arte%20e%20Arqueologia%20de%20Rio%20de%20Moinhos%2
>> C%20Portugal&-find
>> 
>> 
>> This next FM7 CWP request returns successfully once the search string is
>> truncated before the encoded characters:
>> http://fm7/fmi/xml/FMPXMLRESULT.xml?-db=esprit&-lay=web_search&Location=Asso
>> cia&-find
>> 
>> 
>> Surprisingly, this request which truncates the search immediately after the
>> first foreign characters also returns successfully. If the next character in
>> the search string, "o",  is added though (either normally or encoded), we
>> see the -1 error code.
>> http://itsnt206.iowa.uiowa.edu/fmi/xml/FMPXMLRESULT.xml?-db=esprit&-lay=web_
>> search&Location=Associa%E7%E3&-find
>> 
>> 
>> The FM6 request, which returns successfully:
>> http://fm6/FMPro?-db=slate_.fp5&-lay=Layout%20%231&-format=-fmp_xml&Location
>> =Associa%E7%E3o%20Local%20de%20Arte%20e%20Arqueologia%20de%20Rio%20de%20Moin
>> hos%2C%20Portugal&-find
>> 
>> 
>> Comparing the two CWP requests for the Location field (FM6, FM7):
>> Location=Associa%E7%E3o+Local+de+Arte+e+Arqueologia+de+Rio+de+Moinhos%2C+Por
>> tugal&-find
>> Location=Associa%E7%E3o+Local+de+Arte+e+Arqueologia+de+Rio+de+Moinhos%2C+Por
>> tugal&-find
>> 
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>> 
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list



More information about the FX.php_List mailing list