Hi,
how can I simply convert a string to a distinct character encoding inside my basic macro, without writing it to a file ?
(My macro sends an email and this string is the subject of the email - it seems encoding is different between my system mail and LibreOffice and some characters are not displayed properly).
Thanks for your help
[Dropped] Basic - Change String variable encoding
[Dropped] Basic - Change String variable encoding
Last edited by MrProgrammer on Mon Aug 28, 2023 4:50 am, edited 1 time in total.
Reason: Dropped: No response to questions in May 2023
Reason: Dropped: No response to questions in May 2023
LibreOffice 5.4.7.2.M6 on Windows 10
Re: Basic - Change String variable encoding
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: Basic - Change String variable encoding
Thanks for your answer but it didn't change anything, as, i guess, problem is on mail software side.
convertToUrl keeps my characters as they should be, but then my mail subject comes with a "file:///" header...
convertToUrl keeps my characters as they should be, but then my mail subject comes with a "file:///" header...
LibreOffice 5.4.7.2.M6 on Windows 10
Re: Basic - Change String variable encoding
Replace(convertToUrl(myString),"file:///","") does the job but it's a bit of cheating...
LibreOffice 5.4.7.2.M6 on Windows 10
Re: Basic - Change String variable encoding
You seem to have already a kind of workaround meeting your needs.
But, always trying to learn a bit, I would ask:
WHAT distinct character encoding are you talking of?
WHAT system is "my system" here?
WHAT service did you use to create the mail? WHAT method was used to set the subject?
WHAT characters are displayed WHERE not properly.
Basically an example consisting of 4 lines might help:
The subject string I fed into the process
The method call by which I tried to set the subject
The subject as I expected it to be displayed to the addressee
The actual display he(f/m) got.
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
---
Lupp from München
Re: Basic - Change String variable encoding
Hi @DCTN54,
I see you've found a workaround, but @Lupp brings up some good points. Knowing the specific encoding you're targeting, the system you're working on, the mail service you're using and how the subject is being set would be helpful.
Also, it would be useful to know exactly which characters aren't displaying properly and where they aren't displaying correctly. Sometimes it's a case of special characters or non-ASCII characters that aren't being handled right.
And if you have examples of the original subject string, the method call used, and what the subject should look like vs. what it actually looks like, those could be really helpful for us to provide better guidance.
I see you've found a workaround, but @Lupp brings up some good points. Knowing the specific encoding you're targeting, the system you're working on, the mail service you're using and how the subject is being set would be helpful.
Also, it would be useful to know exactly which characters aren't displaying properly and where they aren't displaying correctly. Sometimes it's a case of special characters or non-ASCII characters that aren't being handled right.
And if you have examples of the original subject string, the method call used, and what the subject should look like vs. what it actually looks like, those could be really helpful for us to provide better guidance.
OpenOffice 4.1.14
OS
OS