SeunMatt / mysql-backup4j

mysql-backup4j is a library for programmatically exporting mysql databases and sending the zipped dump to email, Amazon S3, Google Drive or any other cloud storage of choice
MIT License
124 stars 71 forks source link

unknown file encoding #32

Closed karokhaziz closed 1 year ago

karokhaziz commented 1 year ago

Hi when i want to resore backup file in workbench it give me this message unknown file encoding it say its not utf8 its work fine in macos but in windows it has this issue how can i fix this issue thanks

karokhaziz commented 1 year ago

i find the issue its from FileOutputStream outputStream = new FileOutputStream( new FileOutputStream(sqlFolder + "/" + sqlFileName)); replace it to OutputStreamWriter outputStream =new OutputStreamWriter(Files.newOutputStream(Paths.get(sqlFolder + "/" + sqlFileName)), StandardCharsets.UTF_8);