1 2 3 4 5 6 7 8 9 10 11
| Private Declare Function IsTextUnicode Lib "advapi32" (ByVal lpBuffer As String, ByVal cb As Long, lpi As Long) As Long
Private Sub CommandButton1_Click()
Dim ch As String
ch = "n'importe quoi"
MsgBox "ch est_elle en unicode ? --->> " & CBool(IsTextUnicode(ch, Len(ch), &H2))
ch = StrConv(ch, vbUnicode)
MsgBox "ch est-elle maintenant en unicode? --->> " & CBool(IsTextUnicode(ch, Len(ch), &H2))
ch = StrConv(ch, vbFromUnicode)
MsgBox "ch est-elle encore en unicode? --->> " & CBool(IsTextUnicode(ch, Len(ch), &H2))
End Sub |