mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-22 02:44:42 +00:00
Fixes handling of UTF-8 encoded JSON files (stripping BOM if necessary). Fixes #1375.
This was SVN commit r11739.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2011 Wildfire Games.
|
||||
/* Copyright (C) 2012 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
@@ -1018,7 +1018,7 @@ CScriptValRooted ScriptInterface::ReadJSONFile(const VfsPath& path)
|
||||
return CScriptValRooted();
|
||||
}
|
||||
|
||||
std::string content(file.GetBuffer(), file.GetBuffer() + file.GetBufferSize()); // assume it's UTF-8
|
||||
std::string content(file.DecodeUTF8()); // assume it's UTF-8
|
||||
|
||||
return ParseJSON(content);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user