Index: tools/sapi_voice.vbs =================================================================== --- tools/sapi_voice.vbs (revision 18147) +++ tools/sapi_voice.vbs (working copy) @@ -156,12 +156,7 @@ ' Filestream object for output Set oSpFS = CreateObject("SAPI.SpFileStream") - If oSpVoice.Voice.MatchesAttributes("Vendor") Then - oSpFS.Format.Type = AudioFormat(oSpVoice.Voice.GetAttribute("Vendor")) - Else - ' for SAPI engin without Vendor attribute. - oSpFS.Format.Type = AudioFormat("Microsoft") - End If + oSpFS.Format.Type = AudioFormat(oSpVoice.Voice.GetAttribute("Vendor")) End If Do @@ -177,11 +172,7 @@ If bSAPI4 Then WScript.StdOut.WriteLine oTTS.MfgName(nMode) Else - If oSpVoice.Voice.MatchesAttributes("Vendor") Then - WScript.StdOut.WriteLine oSpVoice.Voice.GetAttribute("Vendor") - Else - WScript.StdOut.WriteLine "Microsoft" - End If + WScript.StdOut.WriteLine oSpVoice.Voice.GetAttribute("Vendor") End If End Select Case "SPEAK" @@ -232,15 +223,13 @@ ' Decode an UTF-8 string into a standard windows unicode string (UTF-16) Function UTF8decode(ByRef sText) Dim i, c, nCode, nTail, nTextLen - Dim aData UTF8decode = "" - aData = Split(sText, ",", -1) nTail = 0 - nTextLen = UBound(aData) - i = 0 + nTextLen = Len(sText) + i = 1 While i <= nTextLen - c = CInt(AData(i)) + c = Asc(Mid(sText, i, 1)) i = i + 1 If c <= &h7F Or c >= &hC2 Then ' Start of new character If c < &h80 Then ' U-00000000 - U-0000007F, 1 byte @@ -260,7 +249,7 @@ While nTail > 0 And i <= nTextLen nTail = nTail - 1 - c = CInt(AData(i)) + c = Asc(Mid(sText, i, 1)) i = i + 1 If (c And &hC0) = &h80 Then ' Valid continuation char nCode = nCode * &h40 + (c And &h3F)