AnsweredAssumed Answered

UTF8 not supported in scriptstep Insert From URL

Question asked by kalle_samuelsson on Jun 4, 2012
Latest reply on Jun 10, 2012 by CamelCase

Summary

UTF8 not supported in scriptstep Insert From URL

Product

FileMaker Pro

Version

12.0.1

Operating system version

MacOSX Lion, Windows7

Description of the issue

When using the scriptstep Insert From URL and specifying GET-parameters to send with the request there is no UTF8 support fo the values in the parameters.

Example 1 (Google Geocode Service):
Insert From URL[ "http://maps.googleapis.com/maps/api/geocode/json?address=flöjelbergsgatan20&sensor=false&region=se" ]

This does not work, google returns "No results". Notice the swedish character ö (&ouml) in the address parameter send with the request.

Example 2 (Google Geocode Service):
Insert From URL[ "http://maps.googleapis.com/maps/api/geocode/json?address=flojelbergsgatan20&sensor=false&region=se" ]

This example works and returns address objects as json formated string. We changed the swedish character ö (&ouml) to a simple o (removed the dots).

It does not matter if we use GetAsURLEncoded() to contain/convert the URL string.

I do not know if FMI considers this a bug since the manual says nothing about UTF8 support for the scriptstep Insert From URL, but we sure hope you will add UTF8 support in 12.0.2!

Steps to reproduce the problem

1: Create a textfield called Result

2: Create a script called Geocode

3: Add scriptstep Insert From URL to the script Geocode

4: Make the Result the target field for the scriptstep

5: Set this string as the URL to fetch result from
http://maps.googleapis.com/maps/api/geocode/json?address=flöjelbergsgatan20&sensor=false&region=se

6: Save the script, goto browse mode and run the script

Expected result

{
   "results" : [
      {
         "address_components" : [
            {
               "long_name" : "20A",
               "short_name" : "20A",
               "types" : [ "street_number" ]
            },
            {
               "long_name" : "Flöjelbergsgatan",
               "short_name" : "Flöjelbergsgatan",
               "types" : [ "route" ]
            },
            {
               "long_name" : "Mölndal",
               "short_name" : "Mölndal",
               "types" : [ "administrative_area_level_2", "political" ]
            },
            {
               "long_name" : "Sverige",
               "short_name" : "SE",
               "types" : [ "country", "political" ]
            },
            {
               "long_name" : "43137",
               "short_name" : "43137",
               "types" : [ "postal_code" ]
            },
            {
               "long_name" : "Mölndal",
               "short_name" : "Mölndal",
               "types" : [ "postal_town" ]
            }
         ],
         "formatted_address" : "Flöjelbergsgatan 20A, 431 37 Mölndal, Sverige",
         "geometry" : {
            "location" : {
               "lat" : 57.67623569999999,
               "lng" : 12.00851110
            },
            "location_type" : "ROOFTOP",
            "viewport" : {
               "northeast" : {
                  "lat" : 57.67758468029150,
                  "lng" : 12.00986008029150
               },
               "southwest" : {
                  "lat" : 57.67488671970849,
                  "lng" : 12.00716211970850
               }
            }
         },
         "partial_match" : true,
         "types" : [ "street_address" ]
      }
   ],
   "status" : "OK"
}

Actual result

{
   "results" : [],
   "status" : "ZERO_RESULTS"
}

Exact text of any error message(s) that appear

No error message, simply no records found because the ö character in the address GET param is not passed correctly

Configuration information

My operating system is set to Swedish, so is FileMaker Pro Advanced

Workaround

Try changing the ö character to a o. Not a good workaround but at least it is something.

Outcomes