Skip to content

Specify charset when creating database. - #52

Merged
P1cheneG merged 2 commits into
FirebirdSQL:mainfrom
P1cheneG:specify_charset_when_creating_database
Nov 20, 2026
Merged

P1cheneG merged 2 commits into
FirebirdSQL:mainfrom
P1cheneG:specify_charset_when_creating_database

Conversation

@P1cheneG

Copy link
Copy Markdown
Contributor

Fixes #51

@P1cheneG
P1cheneG requested a review from MrTeeett November 19, 2026 06:19
@P1cheneG P1cheneG self-assigned this Nov 19, 2026
Comment thread fbconn/fbconn.go Outdated
dpb.PutInt32(fbproto.Isc_dpb_sql_dialect, 3)
if config.CreateDatabase {
dpb.PutInt32(fbproto.Isc_dpb_set_db_sql_dialect, 3)
dpb.PutString(fbproto.Isc_dpb_set_db_charset, config.Encoding)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, the database encoding explicitly specified in Config.DPB is overwritten.

For example, the connection uses Encoding = “UTF8”, but isc_dpb_set_db_charset = WIN1251 is passed in Config.DPB. The new line adds a second entry: isc_dpb_set_db_charset = UTF8, and the server uses the last value. As a result, a UTF-8 database is created instead of a WIN1251 database.

The connection encoding and the database encoding are independent parameters.

@P1cheneG
P1cheneG merged commit e2d7c25 into FirebirdSQL:main Nov 20, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Database always created with NONE character set

2 participants