[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Is there a gambas way to detect a files charset?
[Thread Prev] | [Thread Next]
- Subject: Is there a gambas way to detect a files charset?
- From: Bruce Steers <bsteers4@xxxxxxxxx>
- Date: Fri, 13 Nov 2026 12:45:37 +0000
- To: Gambas Mailing List <user@xxxxxxxxxxxxxxxxxxxxxx>
Can gambas do what I'm doing with the file command here detecting the files charset for conversion to UTF8? Public Sub FileLoadUTF8(Path As String) As String Dim sEncode As String Shell "file -b --mime-encoding " & Shell(Path) Wait To sEncode if sEncode Like "utf-8" Then Return File.Load(Path) Else Return Conv(File.Load(Path), RTrim(sEncode), "UTF-8") Endif End Or would using the file command be the best way? Respects BruceS