For whatever reason, periods in the names of settings or in the keys of dictionaries will automatically be converted to underscores.
local plugin = PluginManager():CreatePlugin()
plugin:SetSetting(".",{["h.f"] = "a.b"})
local setting = plugin:GetSetting"_" -- period converted to underscore
for i,v in pairs(setting) do
print(i,v)
end
This prints
h_f a.b
The period in the key is converted to an underscore, but the period in the value remains.
3 Likes
Usually a .
represents a directory change. I’d assume this is intentional otherwise the machine may think you’re using an object. I’m not entirely sure but that’s just my guess.
Decided to bring this issue to light again and see if any engineer attention or answer can be brought as to why this is the case.
I realised this was an issue when I attempted to save a dictionary with keys that had periods in them. When I was doing comparisons between new data and old I was surprised to find the keys didn’t match until I found out that the periods got converted into underscores!
I feel like this shouldn’t be the case and I’d hate to have to recursively search through the new data and convert the periods to underscores and then fear that another name with similar formatting will exist (Although I can just use an abnormally larger string for replacement but the whole point is that this should NOT be happening).