The name is: Comunità Terapeutica … but it is written as Comunit(strange symbol).
Why, it is not enough to transcribe the name with .Convert Encoding(Encoding.WindowsANSI)
Like Alberto said: Most likely you haven’t told Xojo (with DefineEncoding) which encoding the string is in, and in that case, ConvertEncoding can’t help you as it doesn’t know where to start. And if Xojo knew about the current encoding, ConvertEncoding wouldn’t even be necessary. Having said that it might be a good idea to convert all your strings to UTF-8 – after you have defined their current encoding.
Excuse my ignorance, what is the difference between .Convert Encoding(Encoding.WindowsANSI) and .Convert Encoding(Encoding.UTF8) ?
Is it something related to the computer where the program runs? Because this morning, the same program on a different computer no longer gives me that error, so I think it’s something related to the operating system or its settings? In the sense that it seems that on some computers the à is transformed into a strange symbol, on others the à is à. I would like the à to be à on every computer, just as the è must be è, the ì must be ì etc…etc…
If you give us the OS name/version that runs on these two computers, we may explain.
In short, ANSI (as you wrote) is used on Windows while UTF8 is used on macOS.
At the beginning of the computing for the rest of us, é on Windows does not have the same value as the é on macOS.
The characters values from 128 to 255 the same value on macOS.
It is just a conversion to two different encodings, either the old and limited WindowsANSI or the modern UTF-8 that encompasses all of Unicode.
Xojo can deal with both encodings just fine, provided you start with a known encoding (i.e. you have called DefineEncoding before ConvertEncoding). But UTF-8 is the preferred encoding that Xojo uses for any strings created internally and you save a lot of implicit conversions when you convert incoming data to UTF-8 as early as possible.
Depending on the applied encoding, some or all of the characters available in the 128 to 255 range changes (except when using ASCII, of course). Following are examples of just three encodings:
They could be using different default encodings and one just happens to match the data. You need to 1) know what encoding the data was saved with, and 2) use DefineEncoding to tell Xojo what that encding is.
Any time you save data and then read it back in, you lose the encoding and have to define it for Xojo.
I was pointing out that in UTF-8, the range from 80 to FF is not used for characters; UTF-8 has its own use for them. Unicode code points above 7F are encoded as two or more bytes.