Bug 102210 - Cannot use '°' character in subroutine name
Summary: Cannot use '°' character in subroutine name
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
3.6.7.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: interoperability
Keywords: filter:xls
Depends on:
Blocks: Macro-VBA
  Show dependency treegraph
 
Reported: 2016-09-15 16:33 UTC by rapper.skull
Modified: 2022-09-15 10:53 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
Test file with '°' character in subroutine name (6.00 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2016-09-16 09:04 UTC, rapper.skull
Details
Test file with '°' charcater in subroutine name (38.00 KB, application/vnd.ms-excel)
2016-10-23 10:36 UTC, rapper.skull
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rapper.skull 2016-09-15 16:33:54 UTC
I am trying to open an XLS file downloaded from the internet but I get BASIC syntax error on some lines, because of the use of the ° character in a subroutine name. Probably other Office applications consider the character acceptable and some people think it's safe to use. Even if I think special characters should not be used, it's still a compatibility issue and should be resolved.
Comment 1 Aron Budea 2016-09-16 03:48:46 UTC
Can you provide a sample file?
Comment 2 rapper.skull 2016-09-16 09:04:19 UTC Comment hidden (obsolete)
Comment 3 Aron Budea 2016-09-18 00:25:18 UTC Comment hidden (obsolete)
Comment 4 rapper.skull 2016-09-18 09:18:12 UTC Comment hidden (obsolete)
Comment 5 Aron Budea 2016-09-19 00:12:06 UTC Comment hidden (obsolete)
Comment 6 Buovjaga 2016-09-19 09:20:08 UTC Comment hidden (obsolete)
Comment 7 rapper.skull 2016-09-19 21:15:08 UTC Comment hidden (obsolete)
Comment 8 tommy27 2016-10-19 20:44:10 UTC Comment hidden (obsolete)
Comment 9 rapper.skull 2016-10-23 10:36:48 UTC
Created attachment 128187 [details]
Test file with '°' charcater in subroutine name

Created with Excel 2016. Does not work in LibreOffice.
Comment 10 Aron Budea 2016-10-23 21:28:51 UTC
While I can't test in Office, I can confirm the second test file gives syntax error during calling SubWith°Character in LO 5.2.2.2 / Windows 7.
Comment 11 Buovjaga 2016-10-24 17:28:36 UTC
Problem is already in 3.6.
In 3.3, the macro is not loaded.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.3.0.0.alpha0+
Build ID: 3498ed37527b7af795f00dc6a55c11e65a313186
CPU Threads: 8; OS Version: Linux 4.7; UI Render: default; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on October 18th 2016

Arch Linux 64-bit
Version 3.6.7.2 (Build ID: e183d5b)
Comment 12 QA Administrators 2017-10-25 08:57:57 UTC Comment hidden (obsolete)
Comment 13 QA Administrators 2019-12-03 13:52:35 UTC Comment hidden (obsolete)
Comment 14 rapper.skull 2019-12-03 16:26:42 UTC
I can confirm that the bug is still present in the latest version of LibreOffice:
Version: 6.3.3.2 (x64)
Build ID: a64200df03143b798afd1ec74a12ab50359878ed
Comment 15 QA Administrators 2021-12-03 04:21:03 UTC Comment hidden (obsolete)
Comment 16 rapper.skull 2021-12-15 09:25:21 UTC
I can confirm that the bug is still present in the latest version of LibreOffice:
Version: 7.2.4.1 (x64) / LibreOffice Community
Build: 27d75539669ac387bb498e35313b970b7fe9c4f9
Comment 17 Andreas Heinisch 2022-01-02 17:18:48 UTC
It is easy to allow such an additional character, but where do we stop? Should we allow all combinations of such characters? SubRoutine°°__°°FunctionName would then be a viable name. 

Imho, hard to decide which characters are allowed and which are not.
Comment 18 Aron Budea 2022-01-02 19:02:02 UTC
When it comes to interoperability, what is allowed in MSO should be allowed either in compatibility mode (if that's possible), or converted to make a valid name in LO.

In VBA subroutine names follow variable naming conventions, which are:
"Variable names must begin with an alphabetic character, must be unique within the same scope, can't be longer than 255 characters, and can't contain an embedded period or type-declaration character."
https://docs.microsoft.com/en-us/office/vba/language/glossary/vbe-glossary#variable
The characters:
https://docs.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/data-types/type-characters
https://docs.microsoft.com/en-us/office/vba/language/concepts/getting-started/visual-basic-naming-rules