** Attempt to figure out the encoding of the database by retrieving page 1 ** and inspecting the header field. If successful, set the pCsr->enc variable ** and return SQLITE_OK. Otherwise, return an SQLite error code. */
| 18121 | ** and return SQLITE_OK. Otherwise, return an SQLite error code. |
| 18122 | */ |
| 18123 | static int dbdataGetEncoding(DbdataCursor *pCsr){ |
| 18124 | int rc = SQLITE_OK; |
| 18125 | int nPg1 = 0; |
| 18126 | u8 *aPg1 = 0; |
| 18127 | rc = dbdataLoadPage(pCsr, 1, &aPg1, &nPg1); |
| 18128 | if( rc==SQLITE_OK && nPg1>=(56+4) ){ |
| 18129 | pCsr->enc = get_uint32(&aPg1[56]); |
| 18130 | } |
| 18131 | sqlite3_free(aPg1); |
| 18132 | return rc; |
| 18133 | } |
| 18134 | |
| 18135 | |
| 18136 | /* |
no test coverage detected