* Census DEA - accent characters error?

For users to report plugin bugs and request plugin enhancements; and for authors to test new/new versions of plugins, and to discuss plugin development (in the Programming Technicalities sub-forum). If you want advice on choosing or using a plugin, please ask in General Usage or an appropriate sub-forum.
Post Reply
User avatar
sbell95
Famous
Posts: 107
Joined: 14 Feb 2021 06:04
Family Historian: V7
Location: Australia

Census DEA - accent characters error?

Post by sbell95 » 09 Oct 2021 04:57

I have just begun to encounter the following error after running Helen's DEA 'Record Census Data (UK)' v1.4:
Screenshot 2021-10-09 155057.jpg
Screenshot 2021-10-09 155057.jpg (18.07 KiB) Viewed 1648 times
This is despite not having any characters out of the ordinary in any of my text fields?
Screenshot 2021-10-09 155115.jpg
Screenshot 2021-10-09 155115.jpg (54.05 KiB) Viewed 1648 times
I also note that this error does not seem to be able to be repeated in the sample project... but doesn't seem to otherwise cause any issues in my main project as the plugin still runs and functions as expected.

Any ideas?
Sarah Bell – Australia
View my tree on Wikitree

User avatar
tatewise
Megastar
Posts: 27080
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Census DEA - accent characters error?

Post by tatewise » 09 Oct 2021 08:56

This is related to handling the innumerable UTF-8 multi-byte Unicode characters beyond the one byte ANSI characters.
That includes not only accented foreign language characters but all Asian characters and unusual symbols.

Plugins should be designed to handle all UTF-8 Unicode characters.
However, the 'Record Census Data (UK)' and related DEA have their File > Encoding set to ANSI and not UTF-8.
So if there is nothing in the Plugin script to counter that, then the warning you are seeing is automatically produced regardless of whether any Unicode characters are actually processed or not.
If you were to add some accented foreign language characters to your data then they would probably get mishandled.

I am surprised the warning does not occur in the Sample Project as it should be the same for all Projects.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
ColeValleyGirl
Megastar
Posts: 4853
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

Re: Census DEA - accent characters error?

Post by ColeValleyGirl » 09 Oct 2021 09:21

I'm surprised -- I'm not seeing that behaviour.

The DEAs all invoke setIupDefaults from the fhUtils library, which sets string encoding to UTF8.

Code: Select all

local function setIupDefaults()
	local function getRegKey(key)
		local sh = luacom.CreateObject("WScript.Shell")
		local ans
		if pcall(function()
			ans = sh:RegRead(key)
		end) then
			return ans
		else
			return nil, true
		end
	end
	iup.SetGlobal("CUSTOMQUITMESSAGE", "YES")
	-- Get Font and size from the Registry for the property box and use as the default font.
	local v
	-- Check for preview value and use if existing
	v = getRegKey("HKEY_CURRENT_USER\\Software\\Calico Pie\\Family Historian 7 Beta\\2.0\\Preferences\\PDX Font")
	if not v then
		v = getRegKey("HKEY_CURRENT_USER\\Software\\Calico Pie\\Family Historian\\2.0\\Preferences\\PDX Font")
	end
	local t = { stringx.splitv(v, ",") } -- first value is size and 14th is font name
	iup.SetGlobal("DEFAULTFONT", t[14] .. " " .. t[1] / 20)
	iup.SetGlobal("UTF8MODE", "YES")
	iup.SetGlobal("UTF8MODE_FILE", "NO") --use file names in the current locale
	fhSetStringEncoding("UTF-8")
end
Sarah, what encoding is your project saved in (Tools > Preferences > File Load/Save > File Saving Options)? Is it UTF8 (default) or UTF16?

Updated to add: changing save enconding to utf16 doesn't make any difference -- I still can't reproduce the error.

User avatar
ColeValleyGirl
Megastar
Posts: 4853
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

Re: Census DEA - accent characters error?

Post by ColeValleyGirl » 16 Dec 2021 10:54

This was fixed in the most recent release of the DEA.

P.S. Mike, it was nothing to do with the DEA encoding.

Post Reply