0

ここで問題があるのはデバッグ出力です

"?uƒn74tn5187r&key=6e6e0936c4e6c48be56a72eba8964df0"

する必要があります

"?u=83n74tn5187r&key=6e6e0936c4e6c48be56a72eba8964df0"

私は別の同様の質問から解決策を試しましたが、失敗しました。

Dim uni As Byte() = Encoding.GetEncoding(437).GetBytes("?uƒn74tn5187r&key=6e6e0936c4e6c48be56a72eba8964df0")
Dim Ascii As String = Encoding.ASCII.GetString(uni)

アスキー= "?u?n74tn5187r&key=6e6e0936c4e6c48be56a72eba8964df0"

私は437を推測する必要があると推測しています..?u=83からの一致までのすべての数字へのブルートフォース攻撃かもしれません?uƒ

=83本当にUnicode-32(電子メール(POP3)からのブラジル形式のテキスト)を読み込もうとしています。ここでこの関数を使用すると、混乱する可能性があると思います。

ただし、この関数がないと、POP3電子メールの本文にはurlencode()のバリアントのように役に立たない可能性がありますが、代わりに..を%20使用します=20

これをどうやって直すのかしら。

 Public Shared Function DecodeQuotedPrintable(ByVal Message As String, Optional ByVal QuickClean As Boolean = False) As String
        'set up StringBuilder object with data stripped of any line continuation tags
        Dim Msg As New StringBuilder(Message.Replace("=" & vbCrLf, vbNullString))

        If QuickClean Then                                                  'perform a quick clean (clean up common basics)
            Return Msg.Replace("=" & vbCrLf, vbNullString).Replace("=0D", vbCr).Replace("=0A", _
                                   vbLf).Replace("=20", " ").Replace("=3D", "=").ToString
        Else                                                                'perform total cleaning
            'store 2-character hex values that require a leading "0"
            Dim HxData As String = "X0102030405060708090A0B0C0D0E0F"
            For Idx As Integer = 1 To &HF                                   'initially process codes 1-15, which require a leading zero
                Msg.Replace("=" & Mid(HxData, Idx << 1, 2), Chr(Idx))       'replace hex data with single character code (SHIFT is faster)
            Next
            For idx As Integer = &H10 To &HFF                               'process the whole 8-bit extended ASCII gambit
                Msg.Replace("=" & Hex(idx), Chr(idx))                       'replace hex data with single character code
            Next
            Return Msg.ToString                                             'return result string
        End If
    End Function

編集: 関数を修正しようとしました(本当に問題が発生するかどうかはわかりません)

Public Shared Function DecodeQuotedPrintable(ByVal Message As String、Optional ByVal QuickClean As Boolean = False)AsString'任意の行継続タグのデータが削除されたStringBuilderオブジェクトを設定しますDimMsgAs New StringBuilder(Message.Replace( "="&vbCrLf、vbNullString ))

If QuickClean Then                                                  'perform a quick clean (clean up common basics)
    Return Msg.Replace("=" & vbCrLf, vbNullString).Replace("=0D", vbCr).Replace("=0A", _
                           vbLf).Replace("=20", " ").Replace("=3D", "=").ToString
Else                                                                'perform total cleaning
    'store 2-character hex values that require a leading "0"

    Msg.Replace("=" & vbCrLf, vbNullString).Replace("=0D", vbCr).Replace("=0A", _
                           vbLf).Replace("=20", " ").Replace("=3D", "%$#@[EQUALS]@#$%").ToString()

    Dim HxData As String = "X0102030405060708090A0B0C0D0E0F"
    For Idx As Integer = 1 To &HF                                   'initially process codes 1-15, which require a leading zero
        Msg.Replace("=" & Mid(HxData, Idx << 1, 2), Chr(Idx))       'replace hex data with single character code (SHIFT is faster)
    Next
    For idx As Integer = &H10 To &HFF                               'process the whole 8-bit extended ASCII gambit
        Msg.Replace("=" & Hex(idx), Chr(idx))                       'replace hex data with single character code
    Next

    Msg.Replace("%$#@[EQUALS]@#$%", "=")

    Return Msg.ToString                                             'return result string
End If

終了機能

4

1 に答える 1

1

「ƒ」は、Windows-1252文字セットのQuotedPrintableエンコーディングでは=83で表されます。

于 2012-01-08T00:16:56.373 に答える