IConfiguration.

StringEncoding(IStringEncoding) Method

Summary

configures the string encoding to be used.

Syntax

void StringEncoding(IStringEncoding encoding)

Remarks

configures the string encoding to be used.

The string encoding can not be changed in the lifetime of a database file. To set up the database with the correct string encoding, this configuration needs to be set correctly before a database file is created with the first call to Db4objects.Db4o.Db4oFactory.OpenFile(System.String) or Db4objects.Db4o.Db4oFactory.OpenServer(System.String,System.Int32) .

For subsequent open calls, db4o remembers built-in string encodings. If a custom encoding is used (an encoding that is not supplied from within the db4o library), the correct encoding needs to be configured correctly again for all subsequent calls that open database files.

Example:
config.StringEncoding(StringEncodings.Utf8());

Parameters

Name Type Description
encoding IStringEncoding

Return Value

Type Description
void

See Also

  • Db4objects.Db4o.Config.Encoding.StringEncodings