Shannon Shang-I think therefore I am

We came here, you and I, to this place and this profession, to be great, to do great things, and give form to great dreams - and we have

GB and BIG5 translate

We can do it with StrConv Function.

  • The VB6 StrConv function, which performs several different conversions on strings, has an optional argument called LCID to specify a LocaleID for a string different than the local system's LocaleID.
  • Code:

    Option Explicit



    Private Sub Command1_Click()

      Text2.Text = ConvertLang(Text1.Text)

    End Sub



    Private Sub Command2_Click()

      Text3.Text = ConvertLang(Text2.Text, 1) & vbCrLf & ConvertLang(ConvertLang(Text1.Text), 1)

    End Sub



    Private Sub Form_Load()

      Text1.Text = "???????"

    End Sub

    Private Function ConvertLang(ByVal strOrig As String, Optional iModel As Integer = 0) As String

    'iModel=0 for gb to big5,=1 for big5 to gb

    Dim iFormLcid As Long

    Dim iToLcid As Long

    Select Case iModel

      Case 0

        iFormLcid = &H804

        iToLcid = &H404

      Case 1

        iFormLcid = &H404

        iToLcid = &H804

    End Select



    ConvertLang = StrConv(StrConv(strOrig, vbFromUnicode, iFormLcid), vbUnicode, iToLcid)



    End Function

    Leave a Comment

    (required) 

    (required) 

    (optional)

    (required)