PassoloApp.ConvertUnicode2ASCII
The SAX Basic Engine uses Unicode to store text. If you write text to an ASCII file, the current system codepage is used to convert the text. In case that the text is based on a different codepage, the text needs to be converted from Unicode using the correct codepage with ConvertUnicode2ASCII before writing to the file.
Syntax
Expression.ConvertUnicode2ASCII (Text as String, CodePage as Long) as String
Expression Required. Object of type PassoloApp
Text The text to be converted
CodePage The codepage to be used for the conversion
Example
Sub main
' Creates a glossary from the current translation list
Dim trn As PslTransList
Set trn = PSL.ActiveTransList
If trn Is Nothing Then Exit Sub
stringcount = trn.StringCount
Open "c:\MyGlossary.txt" For Output As #1
Print #1,trn.SourceList.LangID;Chr(9);trn.Language.LangID
codepage1 = trn.SourceList.Option(pslOptionActualCodepage)
codepage2 = trn.Language.Option(pslOptionActualCodepage)
For i = 1 To stringcount
Dim t As PslTransString
Set t = trn.String(i)
If t.State(pslStateTranslated) Then
Dim s1 As String
s1 = PSL.ConvertUnicode2ASCII(t.SourceText, codepage1)
s2 = PSL.ConvertUnicode2ASCII(t.Text, codepage2)
Print #1,s1;Chr(9);s2
End If
Next i
End Sub