Editing macros, File menu: Export Basic: the created .bas file is in ANSI character set, so special characters are repleced to '?'. This causes data loss. There is no error message.
Created attachment 168457 [details] Example macros what consists special characters, what are not in ANSI character set.
Cause of severity "major": this causes data loss, see the example attachment.
Confirmed in master.
This can cause data loss, so this is not a minor problem. But I can not set the severity, so please anybody set to major.
This could be easily solved by adding just the utf8 character encoding to the out/input stream. I am only concerned about the fact that exported macros using the ANSI format cannot be imported without any problems. Is there a way in LO to detect if a file is encoded with utf8?
(In reply to Andreas Heinisch from comment #5) I'd just use UTF-8 with BOM.
... or use ucsdet_detect, as in https://gerrit.libreoffice.org/c/core/+/102884. But then I'd use a reasonably large detection chunk, maybe even the whole file.
Proposed patch: https://gerrit.libreoffice.org/c/core/+/116004
Andreas Heinisch committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/178adcd8459af63ddb48927207baa5b4efbfda12 tdf#139196 - Import/export macros using utf-8 including BOM It will be available in 7.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
*** Bug 136893 has been marked as a duplicate of this bug. ***
Andreas Heinisch committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/46e924ac80a4abd7f48bd2df34ea4c38738fd745 tdf#139196 - Import/export macros using utf-8 including BOM It will be available in 7.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Tested with: Windows 10 Home Test_Save_vs_ExportBasic_MAKRO.bas https://bugs.documentfoundation.org/show_bug.cgi?id=136893 LibreOffice Version: 7.2.0.0.alpha1+ (x64) / LibreOffice Community Build ID: 187136265d26c014e842550c2f1fc5997736e4fa CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win Locale: de-DE (de_DE); UI: de-DE Calc: CL It's working pretty fine - many thanks :-))
Andreas Heinisch committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/c356e5e0530e609a2ae9e8b11fb3c4ed43f966d4 tdf#139196 - Remove local BOM logic It will be available in 7.3.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.