[Gambas-user] How to manage filenames whit invalid characters in gambas.

Gianluigi gradobag at gradobag.it
Thu Feb 16 15:22:09 CET 2023


Il 16/02/23 13:34, Gianluigi ha scritto:
> Il 16/02/23 12:59, Martin ha scritto:
>> El 16/2/23 a las 12:33, Gianluigi escribió:
>>> Try s = Conv$(s, "ISO-8859-1", "UTF-8")
>>
>> hehe, I test the 1180 options of iconv, but the error is in other 
>> place, the files become from a 20 years old DVD, so everything is 
>> possible.
>>
>> Regrads.
>> Martin.
>>
>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
> But have you tried to convert (s = Conv$(s, "ISO-8859-1", "UTF-8") ) 
> and replace (s = Replace(s, "�", ".")) your files?
>
> Regards
>
> Gianluigi
>
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----

Maybe I was too cryptic, could you post the result of this code?
Of course if it works :-)

Public Sub Main()

   Dim sFile, sPath As String

   sPath = User.Home &/ "<your-mp3-dir>"
   For Each sFile In Dir(sPath, "*")
     If String.Right(sFile, 4) <> ".mp3" Then
       If String.InStr(sFile, "mp3") <> 0 Then
         Print Conv$(sFile, "ISO-8859-1", "UTF-8")
       Endif
     Endif
   Next

End

Regards

Gianluigi



More information about the User mailing list