Hello, eveybody.
In my Windows app, I'm trying to figure out how to play a WAV file safely in the presence of special characters.
I have tried the following code (after putting MMSystem in Uses), which works fine, provided that the application location does not include any stressed letters (e.g. àèéìòù) or any other special characters:
sndPlaySound(pchar(UTF8ToSys(Application.Location + 'welcome.wav')), snd_Async or snd_NoDefault);
The presence of spaces doesn't seem to interfere with the exact app path, whereas special characters are not recognized correctly. The problem is, my language (Italian) is full of stressed letters and I just can't ignore the problem. In fact, the chances of the application location containing special characters are not slim at all.
Do you know any solution to my problem?
Thanks in advance.