You are not logged in.
Pages: 1
ello
I have a settings file with Portuguese characters (eg: configuração).
How do I function RecordLoadJSON recognize these characters?
Follow my code:
TPrograms = packed record
fPrograms: array of record
FGROUP: RawUTF8;
fIDProgram: integer;
fName: RawUTF8;
fDescription: RawUTF8;
end;
end;
const
__TPrograms = 'FPrograms [FGROUP RawUTF8 fIDProgram integer fName RawUTF8 fDescription RawUTF8]';
TTextWriter.RegisterCustomJSONSerializerFromText (TypeInfo (TPrograms), __TPrograms);
v_FileName: = 'FilePrograms.settings';
v_tmp: = StringFromFile (v_FileName);
RemoveCommentsFromJSON (pointer (v_tmp));
RecordLoadJSON (v_programs, pointer (v_tmp), TypeInfo (TPrograms));
Offline
this is the content, part of my JSON file:
{
"fPrograms":
[
{
"fGroup": "CONFIGURAÇÃO",
"fIDProgram": 1,
"fName": "Program",
"fDescription": "Programas"
},
{
"fGroup": "CONFIGURAÇÃO",
"fIDProgram": 3,
"fName": "Form",
"fDescription": "Configurações"
},
]
}
Offline
Please, how do I do so that the file is in utf-8?
Offline
An information, this file was entered by notepad
Offline
Celso, you should use a programmer's text editor, like Sublime Text and save it as UTF8 encoding.
Offline
thanks.
Offline
Pages: 1