Skip to content

Instantly share code, notes, and snippets.

@jonathan-wheeler
Created June 23, 2014 23:26
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save jonathan-wheeler/0f8235f5904365e3c75a to your computer and use it in GitHub Desktop.
Save jonathan-wheeler/0f8235f5904365e3c75a to your computer and use it in GitHub Desktop.
/* Taken zigmob's (http://forums.macrumors.com/showthread.php?t=1742566) workaround a step further
And added some triggers to clean up these dodgy character combinations (ff, fi, fl).
Still crashes on initial message read but saves having to manually run the sql query eve time a message contains the character combinations */
-- Working well for me so far --
CREATE TRIGGER insert_Ff AFTER INSERT ON ZWAMESSAGE
BEGIN
UPDATE ZWAMESSAGE
SET ZTEXT = replace( ZTEXT, 'ff', 'f f')
WHERE ZWAMESSAGE.ZTEXT like '%ff%';
END;
CREATE TRIGGER insert_Fi AFTER INSERT ON ZWAMESSAGE
BEGIN
UPDATE ZWAMESSAGE
SET ZTEXT = replace( ZTEXT, 'fi', 'f i')
WHERE ZWAMESSAGE.ZTEXT like '%fi%';
END;
CREATE TRIGGER insert_Fl AFTER INSERT ON ZWAMESSAGE
BEGIN
UPDATE ZWAMESSAGE
SET ZTEXT = replace( ZTEXT, 'fl', 'f l')
WHERE ZWAMESSAGE.ZTEXT like '%fl%';
END;
@wugulino
Copy link

I tried to create the triggers but it says there's a syntax error (which is not the case). It doesn't care what code I put in the trigger, it also complains about an imaginary error.

@davidrsim
Copy link

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment