Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Accent Marks - strip or filter

Featured Replies

I'm looking for a way to strip or filter out "accent marks" like this é

The below code strips out the entire character.

Filter( yourTextFieldHere ; "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890`~!@#$%^&*()_+=-[];',./{}|:"<>? " ) 

Wondering if there is an alternative way to strip out the accent mark but keep the character?

convert the accent to the real character like

substitute ( text ; "é" ; "e" )

  • Author

That's assuming you know what the character is. This is a calculation field that would strip the accent mark and leave the character (whatever that would be.

perhaps some creative use of http://www.briandunning.com/cf/175 or http://www.briandunning.com/cf/285

you would have to create a nested substitute such as

Substitute (text ; ["å" ;"a" ]; ["é" ; "e"] ;[ "ü"; "u"] )

basically a set for every accent you wish to substitute.

  • Author

Hmm. I'll take a look at both options, luckily most accents are on the "vowels" (atleast for the characters I'm dealing with)

Thanks for the suggestions, I'm sure one of them will work just fine.

The only way to do this in Filemaker is by multiple substitutes - which means you have to actively list all possible accented characters. There may be another way to do this outside of Filemaker - search for "Unicode decompose".

  • 4 years later...

Yeah… I know this topic is a bit old, but this might help someone.

Multiple substitutes is not the only way to do this in Filemaker. Filemaker talks AppleScript which opens the whole world !

OK Comment, strictly speaking you are doubly right. AppleScript is "outside of Filemaker" even if you write it inside, and the way to go is indeed Unicode manipulation  :Whistle:

Perl does this very well, and you can call Perl from AppleScript from Filemaker. Twisted or what !?  :logik:

You need a temporary field in Filemaker to pass in the string you want to check, as you can't pass variables directly to AppleScripts (yet?).

 

As from there, in your verification script just include a "Do AppleScript" line, with the following in the script section :

 

 

set the_string to field "VarTemp" of current record
 
set p_script to ¬
"# -*- coding: utf-8 -*-
import unicodedata, sys
 
def normalize(x):
    normal_form_1 = 'NFKD'
    normal_form_2 = 'NFC'
    x = unicodedata.normalize(normal_form_2, x)
    x = x.lower()
    x = x.replace(u'ß', u'ss')
    x = x.replace(u'å', u'aa')
    x = unicodedata.normalize(normal_form_1, x)
    x = u''.join([c for c in x if not unicodedata.combining©])
    x = x.encode('utf-8')
    return x
arg = sys.argv[1].decode('utf-8')
x = normalize(arg)
print x"
 
set p_script to quoted form of p_script
set the_string to quoted form of the_string
 
set the_result to (do shell script ("python -c " & p_script & " " & the_string))
 
set field "VarTemp" of current record to the_result
 
* "VarTemp" being the temporary field that you set up in Filemaker.
 
Credits to Jürgen Schell for the Python/AppleScript work. I merely integrated it into Filemaker  :worship:
Filemaker talks AppleScript which opens the whole world !

 

Well, Filemaker talks AppleScript - but only when running on a MacOS platform, so strictly speaking ...  :hmm:

 

Still, I suppose you could run a very similar code in Java using the ScriptMaster plugin. So now the only remaining question is what is this good for.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.