Caveats
This page put together miscellaneous topics.
Unicode Handling
We decided to use FFileHelper::LoadFileToString
to load files into FString
instances, which handles the following encodings:
- UTF8 without BOM
- UTF8 with BOM
- UTF16 LE with BOM
- UTF16 BE with BOM
If you can choose an encoding we recommend use UTF8 without BOM across the board. You can setup an .editorconfig
to enforce it.
Dump Assets
In the context menu we provide some shortcut actions for dumping arbitrary asset to textual presentation, which is a bit similar to UE's Export asset.
Dump to JSON
sample output:
// /Game/Example
{
"$type" : "/DcJsonAsset/DcFixture/DcTestBPDataAsset",
"StrField" : "Hello DataConfig Json Asset",
"IntField" : 43,
"NameField" : "None"
}
Dump To Log
sample output:
# Datum: 'BlueprintGeneratedClass', 'DcTestBPDataAsset_C'
<ClassRoot> 'DcTestBPDataAsset_C'
|---<Name> 'StrField'
|---<String> 'Hello DataConfig Json Asset'
|---<Name> 'IntField'
|---<Int32> '43'
|---<Name> 'NameField'
|---<Name> 'None'
|---<Name> 'AssetImportData'
|---<ClassRoot> 'AssetImportData'
| |---<Name> 'SourceFilePath'
| |---<String> ''
| |---<Name> 'SourceFileTimestamp'
| |---<String> ''
| |---<Name> 'SourceData'
| |---<StructRoot> 'AssetImportInfo'
| |---<StructEnd> 'AssetImportInfo'
|---<ClassEnd> 'AssetImportData'
|---<Name> 'AssetBundleData'
|---<StructRoot> 'AssetBundleData'
| |---<Name> 'Bundles'
| |---<ArrayRoot>
| |---<ArrayEnd>
|---<StructEnd> 'AssetBundleData'
|---<Name> 'NativeClass'
|---<ClassReference> 'DcTestBPDataAsset_C'
<ClassEnd> 'DcTestBPDataAsset_C'
We try to make sure the dump actions doesn't crash. When running into unrecognized properties it should fail with explicit error.
There's also batch process Dc.DumpDirectory
that dumps all data assets. We've tested it against Lyra and CitySample project and it
have pretty readable output results. Note that currently we made minimal efforts to import the output JSON, but the current setup should've
covered most common cases.