[FONT=Consolas][COLOR=#595959]#Const EarlyBound = False[/COLOR][/FONT]
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
[FONT=Consolas][COLOR=#595959]Function WriteUTF8(sText As String, sFile As String) As Boolean[/COLOR][/FONT]
[COLOR=#595959][FONT=Consolas] ' Returns True if sText saved successfully as UTF-8 in sFile[/FONT][/COLOR]
<o:p></o:p>
[FONT=Consolas][COLOR=#595959] On Error GoTo Oops[/COLOR][/FONT]
<o:p></o:p>
[COLOR=#595959][FONT=Consolas] #If EarlyBound Then[/FONT][/COLOR]
[COLOR=#595959][FONT=Consolas] ' Requires a reference to Microsoft ActiveX Data Objects[/FONT][/COLOR]
[COLOR=#595959][FONT=Consolas] With New ADODB.Stream[/FONT][/COLOR]
[COLOR=#595959][FONT=Consolas] #Else[/FONT][/COLOR]
[COLOR=#595959][FONT=Consolas] ' No reference required[/FONT][/COLOR]
[COLOR=#595959][FONT=Consolas] Const adTypeText As Long = 2[/FONT][/COLOR]
[COLOR=#595959][FONT=Consolas] Const adSaveCreateOverWrite As Long = 2[/FONT][/COLOR]
[COLOR=#595959][FONT=Consolas] With CreateObject("ADODB.Stream")[/FONT][/COLOR]
[COLOR=#595959][FONT=Consolas] #End If[/FONT][/COLOR]
[COLOR=#595959][FONT=Consolas] .Type = adTypeText[/FONT][/COLOR]
[COLOR=#595959][FONT=Consolas] .Charset = "utf-8"[/FONT][/COLOR]