Home > Back-end >  Delphi XE2 Encodestring and IdencoderMIME Encodestring difference
Delphi XE2 Encodestring and IdencoderMIME Encodestring difference

Time:09-24

Rookie, novice, recently started learning Delphi XE2, meet a problem about BASE64,
XE2 using two methods: can be encoded Encodestring and IdencoderMIME Encodestring
I want to achieve with the interface to upload an XML:
<? The XML version="1.0" encoding="GBK"?>

0 & lt;/InfoKind>
Test & lt;/Name>
110101000000001 & lt;/Code>
Address & lt; Account>
Telephone & lt; Phone>
17 & lt;/Rate>
Note & lt;/Notes>

Use EncodeString coding, to get:
PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iR0JLIj8 + DQogPGRhdGE + DQogICAgICA8SW5m
B0tpbmQ + MDwvSW5mb0tpbmQ + CQ0KICAgICAgPE5hbWU + suLK1DwvTmFtZT4JDQogICAgICA8Q29k
ZT4xMTAxMDEwMDAwMDAwMDE8L0NvZGU + CQ0KICAgICAgPEFjY291bnQ + tdjWtzxBY2NvdW50PgkN
CiAgICAgIDxQaG9uZT6157uwPFBob25lPgkNCiAgICAgIDxSYXRlPjE3PC9SYXRlPgkNCiAgICAg
IDxOb3Rlcz6xuNeiPC9Ob3Rlcz4NCiA8L2RhdGE + DQo=

Use IdencoderMIME encodestring coding, get:
PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iR0JLIj8 + DQogPGRhdGE + DQogICAgICA8SW5mb0tpbmQ + MDwvSW5mb0tpbmQ + CQ0KICAgICAgPE5hbWU + Pz88L05hbWU + CQ0KICAgICAgPENvZGU + MTEwMTAxMDAwMDAwMDAxPC9Db2RlPgkNCiAgICAgIDxBY2NvdW50Pj8/PEFjY291bnQ + CQ0KICAgICAgPFBob25lPj8/PFBob25lPgkNCiAgICAgIDxSYXRlPjE3PC9SYXRlPgkNCiAgICAgIDxOb3Rlcz4/PzwvTm90ZXM + DQogPC9kYXRhPg==

Server after receiving, decoding:
1. Use EncodeString
<? The XML version="1.0" encoding="GBK"?>


Address & lt; Account>
?? e a ? ? 鍿 隵 e a ? ? 鍿 FS? S Michael & amp; FS he filial piety f & lt; Notes> Note & lt;/Notes>


2. Use IdencoderMIME. Encodestring
<? The XML version="1.0" encoding="GBK"?>

0 & lt;/InfoKind>
??
110101000000001 & lt;/Code>
??
??
17 & lt;/Rate>
??


A Chinese garbled, a Chinese character into???

I want to ask next to complete the decoding Chinese characters out, what should I write?

Encodestring and IdencoderMIME Encodestring difference?

The former 76 characters will automatically wrap, the latter why not change?

CodePudding user response:

Have a great god help me to see

CodePudding user response:

With q, help top, purple potato patch
  • Related