Page 1 of 1

FH V6 Plugin Review

Posted: 18 Dec 2014 12:22
by tatewise
I have quickly reviewed the V6 Plugin Store (excluding my Plugins).
The following Plugins may compromise FH V6 data once users start using Unicode characters outside the ANSI/CP1252 set.
When the Plugin ends there will be a message saying accented characters may have been upset, but does not say exactly which fields are affected.
Those accented characters will have been replaced by unaccented letters and other symbols by ? question marks.
The only solution is to use Edit > Undo Plugin Updates as advised by the warning message.

Add GRO Event to an Individual (no source) by Rodney Begg
Birth/Marriage/Death local Notes may lose Unicode chars.

Address Reformatting by Peter Richmond
Any Address fields may lose Unicode chars.

Clean Living People by Jane Taubman
Any Individual Names may lose Unicode chars.
If changed to use UTF-8 encoding to preserve Unicode, then the upper() function will not work reliably on UTF-8 chars.
This Plugin also loads/saves settings to file, and the settingfile path must be ANSI encoded.
Luckily, if FH is V5.0.7 or later, the Plugin uses fhGetPluginDataFileName('LOCAL_MACHINE')
This usually gives C:\ProgramData\Calico Pie\Family Historian\Plugin Data\Clean Living People.dat and is entirely ASCII characters.
So fhInitialise(5,0,7) should be added.

Clean Up Notes by Jane Taubman
Any cleaned Notes may lose Unicode chars.

Clean up Surname Capitalisation by Jane Taubman
Any Individual Names may lose Unicode chars even in forenames.
If changed to use UTF-8 encoding to preserve Unicode, then the upper() & lower() functions will not work reliably on UTF-8 chars.

Keyword Update by Peter Richmond
Media Keywords may lose Unicode chars.

I think in most, simply using the following statement at the start will fix it.

Code: Select all

if fhGetAppVersion() > 5 then
   fhSetStringEncoding("UTF-8")
   iup.SetGlobal("UTF8MODE","YES")    -- Only if iuplua is used
end
That can be done even before the Author has purchase V6.

Also the Plugins using upper() & lower() need to use the UTF-8 variants defined in plugins:code_snippets:unicode_string_functions|> Unicode String Functions (code snippet).

A snag is that when users upgrade from V5 to V6, any Plugins they already have installed will remain so. Few, if any, of the above Plugins have any mechanism to tell users they have been updated, so the loss of Unicode chars will take them by surprise. They will have to rely upon Edit > Undo Plugin Updates or Backups.

Re: FH V6 Plugin Review

Posted: 19 Dec 2014 13:58
by davidm_uk
Would it be worth making this, or a summary of the plugin compatibility with V5 and V6, a sticky/locked post, for ease of reference?

It's a bit concerning that some non V6 compatible plugins might mess up V6 data, perhaps without any sort of warning.

Re: FH V6 Plugin Review

Posted: 19 Dec 2014 15:51
by tatewise
There is a catch all warning at the end of Plugins, but the user needs to know to use Undo > Plugin Updates to undo the damage.

Even if this thread was made sticky, non-FHUG members would still run foul of the Plugins, and even if the Plugins are updated there is no mechanism to inform users they need to download them.

If the Plugins are already installed, and a user upgrades to FH V6, there is nothing to prevent the Plugins being run.

Re: FH V6 Plugin Review

Posted: 19 Dec 2014 16:22
by Jane
It's only a problem if you have unicode characters in the fields concerned and the message at the end does tell the user 1. a problem occurred and 2. how to undo it.

I will look at my plugins, but at the moment I have far too much on my plate to spend several hours on them this side of Christmas.

Re: FH V6 Plugin Review

Posted: 08 Feb 2015 14:20
by PeterR
I have now updated my two Plugins listed above, having tested them with FH V6.0.2. I can no longer test them with V5 but they should still work OK.

The Edit menu item Undo Plugin Updates suggests that Ctrl+Z is a keyboard shortcut for this command, but it doesn't seem to work. I think I reported this as a problem with FH V5.

Re: FH V6 Plugin Review

Posted: 08 Feb 2015 16:15
by tatewise
Peter, I presume you simply added the code I suggested, and left them as ANSI encoded?
I can test them on FH V5 when they have been approved in the Plugin Store.
I guess you tested them in FH V6 by entering some Unicode accented characters?

Ctrl-Z and Ctrl-Y work for me in FH V6.0.2 providing you have no Menu dropdown selected, and not just for Plugins but any Edit > Undo/Redo.

Re: FH V6 Plugin Review

Posted: 08 Feb 2015 17:12
by PeterR
Mike, Yes I just added the code you suggested plus relevant comments, and saved them; they're still ANSI coded.
Yes, I added some Unicode accented characters and ran the plugins before and after modification to be sure the problem is fixed.

I find that Ctrl+Z for Undo Plugin Updates works OK if I am viewing any window except the results window (the one probably on view when the Plugin ends and which most clearly shows the effects of the Plugin). If I'm viewing the results window, Ctrl+Z merely gives a "ping" sound, but the Edit menu option works OK..

Re: FH V6 Plugin Review

Posted: 08 Feb 2015 17:22
by tatewise
Ah! Yes, ditto Ctrl-Z/Y pings in Results Set window.

Re: FH V6 Plugin Review

Posted: 10 Feb 2015 17:46
by tatewise
Peter, both Plugins work OK in FH V5.

However, Keyword Update does not include the statement:
iup.SetGlobal("UTF8MODE","YES")
So, although it will update FH Media Keywords Ok, the iup dialogues will display Unicode characters in Keywords strangely.

Re: FH V6 Plugin Review

Posted: 11 Feb 2015 11:36
by PeterR
Thanks, Mike. Silly me! Corrected version now submitted.