掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
VB6.0でJISをUNICODEに変換するには (ID:101117)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
それは、JIS:494A(品)からの変換ではなく、 Shift_JIS:9569(品)からの変換の場合かと。>あさん 受信データ中の漢字イン/アウトの有無にもよりますが、 たとえば、こんな感じでいかがでしょう。>ぎもんさん Private Sub Form_Load() Dim a() As Byte ReDim a(1) a(0) = &H49 a(1) = &H4A MsgBox JISBinToString(a, True) End Sub Public Function JISBinToString(ByRef bin() As Byte, Optional forceKanji As Boolean = False) As String Dim xIn(2) As Byte, xOut(2) As Byte xIn(0) = &H1B: xOut(0) = &H1B xIn(1) = &H24: xOut(1) = &H28 xIn(2) = &H42: xOut(2) = &H42 With CreateObject("ADODB.Stream") .Type = 1 'adTypeBinary .Open If forceKanji Then .Write xIn .Write bin If forceKanji Then .Write xOut .Position = 0 .Type = 2 'adTypeText .Charset = "iso-2022-jp" JISBinToString = .ReadText() .Close End With End Function
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.