UTF-8 and converting to HTML entities
Hoping someone here can shed some light. While handling an export in my plugin, some of the metadata has characters encoded with UTF-8. I'd like to convert those to HTML entities. Anyone have sample code for this? I found this function http://lua-users.org/files/wiki_insecure/users/WalterCruz/htmlentities.lua and tweaked the bottom few lines to this:
return string.gsub( str, "[^a-zA-Z0-9 _]",
function (v)
if entities
end)
What I get for a result is the original byte stream passed through without change. Am I missing something with basic Lua syntax or is there a subtlety with Lightroom itself?
Thanks,
db
