We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eb90068 commit 66bc012Copy full SHA for 66bc012
src/ccutil/unicharset.h
@@ -354,15 +354,13 @@ class UNICHARSET {
354
// Returns true if the operation is successful.
355
bool save_to_file(FILE *file) const {
356
STRING str;
357
- if (!save_to_string(&str)) return false;
358
- if (fwrite(&str[0], str.length(), 1, file) != 1) return false;
359
- return true;
+ return save_to_string(&str) &&
+ tesseract::Serialize(file, &str[0], str.length());
360
}
+
361
bool save_to_file(tesseract::TFile *file) const {
362
363
364
- if (file->FWrite(&str[0], str.length(), 1) != 1) return false;
365
+ return save_to_string(&str) && file->Serialize(&str[0], str.length());
366
367
368
// Saves the content of the UNICHARSET to the given STRING.
0 commit comments