You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having troubles trying to read a KeyValues tree from a file that is saved as UTF-8. I was having unexpected behaves in my code, so I decided to read and output the following file, just to see what happens:
KeyValues Error: LoadFromBuffer: missing { in file addons\sourcemod\test1.txt
KeyValues Error: LoadFromBuffer: missing { in file addons\sourcemod\test1.txt
KeyValues Error: LoadFromBuffer: missing { in file addons\sourcemod\test1.txt
KeyValues Error: LoadFromBuffer: missing { in file addons\sourcemod\test1.txt
KeyValues Error: LoadFromBuffer: missing { in file addons\sourcemod\test1.txt
(*test2*),
And my output was:
""
{
}
I think the symbols used by the file to tell it's an UTF-8, is messing with the sourcemod reading it.
P.S.: Ok, so I realized the cause of it, it's the BOM, the UTF-8 without BOM will work, but since I need to use special characters, it's useless, so I just request a feature to allow us to read an UTF-8 file with BOM.
The text was updated successfully, but these errors were encountered:
UTF-8 without BOM is the correct format to use and will support all Unicode characters. None of the Source Engine or SourceMod file routines support byte order marks and it is not something that will be added.
I'm having troubles trying to read a KeyValues tree from a file that is saved as UTF-8. I was having unexpected behaves in my code, so I decided to read and output the following file, just to see what happens:
And I read and output the file using:
I received these on console:
And my output was:
I think the symbols used by the file to tell it's an UTF-8, is messing with the sourcemod reading it.
P.S.: Ok, so I realized the cause of it, it's the BOM, the UTF-8 without BOM will work, but since I need to use special characters, it's useless, so I just request a feature to allow us to read an UTF-8 file with BOM.
The text was updated successfully, but these errors were encountered: