title: Firebird 2.5 database restore using gbak and fix_fss_data returns Malformed string
body: <p>I have an old database and I want to convert it to Firebird 2.5. A problem occurs when restoring the data on tables which contains blob text fields with the well know issue &quot;gbak: ERROR:Malformed string gbak:Invalid data detected&quot;</p>
  <p>Steps performed:</p>
  <ol>
  <li>gfix -user SYSDBA -password masterkey f:\dbb.db -shut -force 0</li>
  <li>gfix -v -full -user SYSDBA -password masterkey f:\dbb.db</li>
  <li>gbak -v -t -g -ig -user SYSDBA -Y F:\backup.log -password &quot;masterkey&quot; f:\dbb.db F:\dbb1.db</li>
  <li>gbak -r -v -o -p 16384 -Y F:\log.txt -user SYSDBA -password masterkey &quot;f:\dbb1.db&quot; &quot;f:\new.db&quot; -fix_fss_data win1251 -rep</li>
  </ol>
  <p>replacing the character set with win1252,utf8 or unicode_fss does not solve the problem.</p>
  <p>I have also tried to migrate the data by using InterBase Data Pump version 3.4.</p>
  <p>Steps:</p>
  <ol>
  <li>backup the metatable</li>
  <li>restore the metatable on a new database</li>
  <li>migrate the data by using InterBase Data Pump</li>
  </ol>
  <p>Errors encountered &quot;Malformed string&quot;.</p>
  <p>All the tables on which the error occur have a field of type &quot;BLOB SUB_TYPE 1 SEGMENT SIZE 80&quot;</p>
  <p>I suspect that at the beginning the database had the charset WIN1252. After that someone changed the charset to UTF8 and changed all the fields definition for charset and collate from WIN1252 to UTF8. Otherwise I do not understand why I get these malformed string errors. Also, I understood that this problem is common to FireBird 2.0 to FireBird 2.5 migrations.</p>
  <p>Does anybody have an idea on how to solve this?</p>