无法解码java中的base64字符串

时间:2016-05-23 10:16:07

标签: java string-decoding

我正在尝试解码base64字符串。但不知何故,它不是解码完整的字符串。下面是base64字符串。

... DQpeWEENCl5MSDE2LDEyDQpeTEwxMjEyDQpeRlQgNTgxLCA0MDMgXkFVTiAgXkZEMDAwNV5GUyBeRlggQ29uZmlndXJhYmxlIFRleHQgMQ0KXkZUIDUwMCwgNTg3IF5BVU4gIF5GREMwMDReRlMgXkZYIENvbmZpZ3VyYWJsZSBUZXh0IDINCl5GVCA1MTAsICA5MCBeQVZOLCA3MCwgNzUgXkZEVk9JRF5GUyBeRlggVGVzdCBMYWJlbA0KDQpeRlQgIDIwLCAzNDMgXkEwTiwgMjgsIDIwIF5GREphbWVzXkZTIF5GWCBTaGlwcGVyIE5hbWUNCl5GVCAgMjAsIDM3MyBeQTBOLCAyOCwgMjAgXkZEUEJeRlMgXkZYIFNoaXBwZXIgQWRkcmVzcw0KXkZUICAyMCwgNDAzIF5BME4sIDI4LCAyMCBeRkQzNyBFeGVjdXRpdmUgRHJeRlMgXkZYIFNoaXBwZXIgQWRkcmVzcw0KXkZUICAyMCwgNDMzIF5BME4sIDI4LCAyMCBeRkRCZXJ3aWNrIE1FIDAzOTAxXkZTIF5GWCBTaGlwcGVyIENpdHkgU3RhdGUgWm == gMCwwXkdCIDc3OCwgMTE5NiwgMkJeRlMgDQpeTEgwDQpeWFoNCg

我可以解码这个base64字符串https://www.base64decode.org/并正确解码它。但是当我尝试使用代码对它进行解码时,它就会介入。(我不确定bur是因为某些特殊字符。)下面是我用来解码的代码。

StringUtils.newStringIso8859_1(Base64.decodeBase64(labelResponse.getLabelUrl().getBytes()))

我不知道出了什么问题。

我期待的输出。

^XA
^LH16,12
^LL1212
^FT 581, 403 ^AUN  ^FD0005^FS ^FX Configurable Text 1
^FT 500, 587 ^AUN  ^FDC004^FS ^FX Configurable Text 2
^FT 510,  90 ^AVN, 70, 75 ^FDVOID^FS ^FX Test Label

^FT  20, 343 ^A0N, 28, 20 ^FDJames^FS ^FX Shipper Name
^FT  20, 373 ^A0N, 28, 20 ^FDPB^FS ^FX Shipper Address
^FT  20, 403 ^A0N, 28, 20 ^FD37 Executive Dr^FS ^FX Shipper Address
^FT  20, 433 ^A0N, 28, 20 ^FDBerwick ME 03901^FS ^FX Shipper City State Zip
^FT  20, 463 ^A0N, 28, 20 ^FD^FS ^FX Shipper Country Code

^FT 148, 634 ^A0N, 32, 35 ^FDJohn Smith^FS ^FX Consignee Contact
^FT 148, 662 ^A0N, 32, 35 ^FD1 Union Ave^FS ^FX Consignee Name
^FT 148, 690 ^A0N, 32, 35 ^FDDanbury CT 06810-5953^FS ^FX Consignee Address 1
^FT 148, 718 ^A0N, 32, 35 ^FD^FS ^FX Consignee Address 2
^FT 148, 746 ^A0N, 32, 35 ^FD^FS ^FX Consignee City State Zip

^FT 212,  25 ^AQN ^FD$13.36^FS ^FX USPS Postage (& Fees) Paid
^FT 212,  51 ^AQN ^FDUS POSTAGE^FS ^FX USPS Postage (& Fees) Paid
^FT 212,  77 ^A0N, 28, 21 ^FD05/21/2016^FS ^FX Shipment Date
^FT 212, 105 ^A0N, 28, 21 ^FD06810^FS ^FX Origin zip
^FT 212, 133 ^A0N, 28, 21 ^FD3 lbs 12 ozs^FS ^FX Package Weight
^FT 212, 161 ^A0N, 28, 21 ^FDZone 1^FS ^FX Destination zone

^FT 364, 134 ^AQN, 22, 14 ^FB270,1,0,C ^FDPitney Bowes^FS ^FX PB
^FT 364, 160 ^AQN, 22, 11 ^FB270,1,0,C ^FDComBasPrice^FS ^FX PB
^FT 364, 189 ^A0N, 32, 22 ^FB270,1,0,C ^FDNO SURCHARGE^FS ^FX PB

^FT 501, 134 ^A0N, 22, 20 ^FB270,1,0,R ^FD022W0030000012^FS ^FX PB
^FT 501, 160 ^A0N, 22, 20 ^FB270,1,0,R ^FDpbSmartPostage^FS ^FX PB
^FT 501, 186 ^A0N, 22, 20 ^FB270,1,0,R ^FD0000004242^FS ^FX PB

^BY2,2.2,^FS
^FT 373, 103 ^B7N,5,5,,18,N ^FH^FD022W04    3x7500=T
 c^FS ^FX Indicia
^BY3,2.0,^FS
^FT  60,1040 ^BCN,154,N,N,N,N^FD>;>842006810>89406109898644001564484^FS ^FX Tracking Barcode
^FT 0,1094 ^AT ^FB776,1,0,C, ^FD9406 1098 9864 4001 5644 84^FS ^FX Tracking Barcode text

^FT   0, 256 ^AUN  ^FB776,1,0,C, ^FDPRIORITY MAIL 1-DAY?^FS ^FX USPS Mail Class
^FT  24, 175 ^AVN,264,264  ^FDP^FS  ^FX  Service ICON

^FT   0, 856 ^AT  ^FB776,1,0,c, ^FDUSPS SIGNATURE TRACKING #^FS ^FX e/ USPS DELIVERY CONFIRMATION
^FT  40, 539 ^A0N, 24, 32  ^FD^FS ^FX Restricted Delivery
^FT 557, 296 ^APN  ^FDDelivery Date: 05/23/2016^FS ^FX Scheduled Delivery Date
^FO 748, 313 ^ADR ^FD^FS ^FX Custom Message

^LRY^FT5,805 ^GB 770,,65^FS
^FT60,800^AUN ^FDTEST LABEL - DO NOT MAIL^FS

^FT   0, 818 ^GB 776,   0, 12B ^FS
^FT   0,1121 ^GB 776,   0, 12B ^FS
^FT   0, 274 ^GB 776,   0,  6B ^FS
^FT   0, 206 ^GB 776,   0,  6B ^FS
^FT 203, 203 ^GB   0, 203,  4B ^FS
^FT 496, 595 ^GB 111,  51,  1  ^FS 
^FO   0,   0 ^GB 776,1198,  2B ^FS 
^LH0
^XZ
|^|
^XA
^LH12,10
^LL1212

^FT  70,  20 ^AQR ^FDPS Form 3816 January 2014 Facsimile^FS
^FT  70, 880 ^AQR ^FB310,1,0,R ^FDCopy 1 - Delivery Unit^FS

^FT  10, 100 ^APR ^FDFollow Proper Scanning procedures for COD delivery and clearance^FS
^FT  50,  20 ^APR ^FD1. DO NOT allow the recipient (addressee or agent) to examine contents before payment^FS
^FT  30,  20 ^APR ^FD2. DO NOT deliver this article until payment is collected^FS
^FT  50, 810 ^APR ^FD3. If payment is by check, enter check number above^FS
^FT  30, 810 ^APR ^FD4. Have customer sign form 3849^FS

^FT 745,  10 ^ASR ^FDDELIVERY EMPLOYEE - Remove copies 1 & 2 at Time of delivery^FS

^FT 655,  15 ^AQR ^FB315,3,0^FDCollect the amount shown below, If customer pays by CHECK or MO payable to the mailer.^FS
^FT 655, 352 ^AQR ^FB280,3,0^FDCollect the amount shown below, if customer pays by CASH (includes MO fee(s))^FS

^FT 200,  20 ^AQR ^FDDelivered By^FS
^FT 200, 410 ^AQR ^FDDate Delivered^FS
^FT 133,  20 ^AQR ^FDDate Payment Sent to Mailer^FS
^FT 200, 640 ^AQR ^FDCheck Number^FS
^FT 133, 410 ^AQR ^FDMoney Order Number(s)^FS

^FT 385,  20 ^ARR ^FDFROM:^FS
^FT 360, 100 ^A0R, 28, 20 ^FDJames^FS
^FT 330, 100 ^A0R, 28, 20 ^FDPB^FS
^FT 300, 100 ^A0R, 28, 20 ^FD37 Executive Dr^FS
^FT 270, 100 ^A0R, 28, 20 ^FDBerwick ME 03901^FS
^FT 240, 100 ^A0R, 28, 20 ^FD ^FS
^FT 385, 638 ^ARR ^FDTO:^FS
^FT 360, 680 ^A0R, 28, 20 ^FDJohn Smith^FS
^FT 330, 680 ^A0R, 28, 20 ^FD1 Union Ave^FS
^FT 300, 680 ^A0R, 28, 20 ^FDDanbury CT 06810-5953^FS
^FT 270, 680 ^A0R, 28, 20 ^FD^FS
^FT 240, 680 ^A0R, 28, 20 ^FD ^FS

^FT 485,  20 ^AQR ^FDDate of Mailing^FS
^FT 447,  20 ^ARR ^FB200,1,0,C ^FD05/21/2016^FS
^FT 535,  55 ^AQR ^FDRegistered Mail Service^FS
^FT 535,  25 ^AQR ^FB25,1,0,C ^FD^FS
^FT 535, 340 ^AQR ^FDPriority Mail Express Service^FS
^FT 535, 310 ^AQR ^FB25,1,0,C ^FD^FS
^FT 435, 255 ^AQR ^FB210,3,0 ^FDRemit COD charges to Sender via Priority Mail Express^FS
^FT 455, 220 ^AQR ^FB30,1,0,C ^FDX^FS
^FT 485, 475 ^AQR ^FDUSPSCA No.^FS

^FT 590,  20 ^AQR ^FB105,2,0    ^FDCheck/MO Amount^FS
^FT 595, 135 ^ASR ^FB220,1,0,C  ^FD$500.00^FS
^FT 590, 352 ^AQR ^FB 75,2,0    ^FDCash Amount^FS
^FT 595, 435 ^ASR ^FB195,1,0,C  ^FD$500.00^FS

^FT 435,960 ^ASR, 120,100  ^FDCOD^FS
^BY2,3.0^FS
^FO 595, 680 ^BCR,80,N,N,N,N^FH^FD>;>842006810>89406109898644001564484^FS
^FT 540, 755 ^A0R, 38, 30 ^FD9406 1098 9864 4001 5644 84^FS

^FO  90,  10 ^GB 330,1178, 2B ^FS
^FO 420,  10 ^GB 310, 620, 2B ^FS

^FO 640,  10 ^GB   0, 620, 2B ^FS
^FO 512,  10 ^GB   0, 620, 2B ^FS
^FO 572,  10 ^GB   0, 620, 2B ^FS
^FO 572, 342 ^GB 160,   0, 2B ^FS
^FO 420, 215 ^GB  92,   0, 2B ^FS
^FO 420, 465 ^GB  92,   0, 2B ^FS
^FO  90, 400 ^GB 135,   0, 2B ^FS
^FO 158,  10 ^GB   0,1178, 2B ^FS
^FO 225,  10 ^GB   0,1178, 2B ^FS
^FO 158, 628 ^GB 292,   0, 2B ^FS

^FO 453, 220 ^GB  25,  25, 2B ^FS
^FO 530,  25 ^GB  25,  25, 2B ^FS
^FO 530, 310 ^GB  25,  25, 2B ^FS

^FO   0,   0 ^GB 778,1198, 1B ^FS 
^LH0
^XZ
|^|^XA
^LH12,12
^LL1218

^FO 10, 20 ^AQR^FDPS Form 3816 January 2014 Facsimile ^FS
^FO 10, 970 ^AQR^FDCopy 2 - Payment ^FS
^FO 145, 15 ^A0R, 30, 28  ^FDPOST OFFICE: Return this copy to mailer with money order(s) or check. Mail payment for only one ^FS
^FO 110, 15 ^A0R, 30, 28  ^FDCOD per EM04 envelope(mailer address will appear in the window). Please secure this copy in the ^FS
^FO 75, 15 ^A0R, 30, 28  ^FDenvelop with tape, if necessary. ^FS
^FO 375, 45 ^A0R, 28, 20  ^FDFROM : ^FS
^FO 350, 105 ^A0R, 28, 20  ^FDJames ^FS
^FO 320, 105 ^A0R, 28, 20  ^FDPB ^FS
^FO 290, 105 ^A0R, 28, 20  ^FD37 Executive Dr ^FS
^FO 260, 105 ^A0R, 28, 20  ^FDBerwick ME 03901 ^FS
^FO 230, 105 ^A0R, 28, 20  ^FD ^FS
^FO 200, 105 ^A0R, 28, 20  ^FD ^FS
^FO 375, 645 ^A0R, 28, 20  ^FDTO : ^FS
^FO 350, 705 ^A0R, 28, 20  ^FDJohn Smith ^FS
^FO 320, 705 ^A0R, 28, 20  ^FD1 Union Ave ^FS
^FO 290, 705 ^A0R, 28, 20  ^FDDanbury CT 06810-5953 ^FS
^FO 260, 705 ^A0R, 28, 20  ^FD ^FS
^FO 230, 705 ^A0R, 28, 20  ^FD ^FS
^FO 200, 705 ^A0R, 28, 20  ^FD ^FS
^FO 555, 25 ^A0R, 30, 28  ^FDDELIVERY EMPLOYEE: Turn in this copy ^FS
^FO 520, 25 ^A0R, 30, 28  ^FDwith the payment you received for the COD ^FS
^FO 485, 25 ^A0R, 30, 28  ^FDarticle and the signed PS Form 3849. BE ^FS
^FO 450, 25 ^A0R, 30, 28  ^FDSURE THE COD NUMBER APPEARS ON ^FS
^FO 415, 25 ^A0R, 30, 28  ^FDTHE MONEY ORDER(S) OR CHECK^FS
^FO 625, 30 ^A0R, 28, 20  ^FDCheck/MO^FS
^FO 600, 30 ^A0R, 28, 20  ^FDAmount^FS
^FO 615, 150 ^A0R, 28, 20  ^FD$500.00^FS
^FO 625, 335 ^A0R, 28, 20  ^FDCash^FS
^FO 600, 335 ^A0R, 28, 20  ^FDAmount^FS
^FO 615, 480 ^A0R, 28, 20  ^FD$500.00^FS
^FO 715, 25 ^A0R, 48, 40  ^FDMail payment for only one COD per envelope^FS
^FO 410, 960 ^ASR, 120,100  ^FDCOD^FS
^BY2,3.0^FS
^FO 590, 675 ^BCR,80,N,N,N,N^FH^FD>;>842006810>89406109898644001564484 ^FS
^FO 520, 725 ^A0R, 38, 30  ^FD9406 1098 9864 4001 5644 84^FS


^FO 185,15^GB 475, 600, 2B ^FS 
^FO 185,615^GB 222, 570, 2B ^FS
^FO 405,15^GB 0, 600, 2B ^FS
^FO 593,15^GB 0, 600, 2B ^FS
^FO 593,325^GB 65, 0, 2B ^FS


^FO 0,0^GB 778, 1196, 2B ^FS 
^LH0
^XZ
|^|^XA
^LH12,12
^LL1218

^FO 10, 20 ^AQR^FDPS Form 3816 January 2014 Facsimile^FS
^FO 10, 970 ^AQR^FDCopy 3 - Mailer^FS
^FO 150, 910 ^A0R, 28, 20  ^FDPostmark^FS 
^FO 150, 630 ^A0R, 28, 20  ^FDCOD Fee^FS 
^FO 115, 650 ^A0R, 38, 30  ^FD$6.65^FS
^FO 80, 630 ^A0R, 28, 20  ^FDPostage^FS
^FO 40, 650 ^A0R, 38, 30  ^FD$13.36^FS
^FO 150, 30 ^A0R, 28, 20  ^FDCheck and Enter Amount (If Applicable)^FS
^FO 100, 75 ^A0R, 28, 20  ^FDUSPS Tracking^FS
^FO 60, 75 ^A0R, 28, 20  ^FDSignature Confirmation^FS
^FO 100, 335 ^A0R, 28, 20  ^FDRestricted Delivery^FS
^FO 60, 335 ^A0R, 28, 20  ^FDSpecial Handling^FS
^FO 110, 535 ^A0R, 28, 20  ^FDReturn^FS
^FO 85, 535 ^A0R, 28, 20  ^FDReceipt^FS
^FO 60, 490 ^A0R, 28, 20  ^FDAmt^FS
^FO 35, 530 ^A0R, 38, 30  ^FD$0.00^FS
^FO 375, 45 ^A0R, 28, 20  ^FDFROM:^FS
^FO 350, 105 ^A0R, 28, 20  ^FDJames^FS
^FO 320, 105 ^A0R, 28, 20  ^FDPB^FS
^FO 290, 105 ^A0R, 28, 20  ^FD37 Executive Dr^FS
^FO 260, 105 ^A0R, 28, 20  ^FDBerwick ME 03901^FS
^FO 230, 105 ^A0R, 28, 20  ^FD^FS
^FO 200, 105 ^A0R, 28, 20  ^FD^FS
^FO 375, 645 ^A0R, 28, 20  ^FDTO:^FS
^FO 350, 705 ^A0R, 28, 20  ^FDJohn Smith^FS
^FO 320, 705 ^A0R, 28, 20  ^FD1 Union Ave^FS
^FO 290, 705 ^A0R, 28, 20  ^FDDanbury CT 06810-5953^FS
^FO 260, 705 ^A0R, 28, 20  ^FD^FS
^FO 230, 705 ^A0R, 28, 20  ^FD^FS
^FO 200, 705 ^A0R, 28, 20  ^FD^FS
^FO 465, 35 ^A0R, 28, 20  ^FDDate of Mailing^FS
^FO 435, 65 ^A0R, 28, 20  ^FD05/21/2016^FS
^FO 515, 75 ^A0R, 28, 20  ^FDRegistered Mail Service^FS
^FO 515, 355 ^A0R, 28, 20  ^FDPriority Mail Express Service^FS
^FO 595, 30 ^A0R, 28, 20  ^FDCheck/MO^FS
^FO 570, 30 ^A0R, 28, 20  ^FDAmount^FS
^FO 585, 150 ^A0R, 28, 20  ^FD$500.00^FS
^FO 595, 335 ^A0R, 28, 20  ^FDCash^FS
^FO 570, 335 ^A0R, 28, 20  ^FDAmount^FS
^FO 585, 480 ^A0R, 28, 20  ^FD$500.00^FS
^FO 655, 25 ^A0R, 38, 30  ^FDSee USPS.COM for claims information^FS
^FO 695, 25 ^A0R, 48, 40  ^FDSAVE THIS RECEIPT^FS
^FO 450, 950 ^ASR, 120,100  ^FDCOD^FS
^BY2,3.0^FS
^FO 640, 675 ^BCR,80,N,N,N,N^FH^FD>;>842006810>89406109898644001564484^FS
^FO 580, 725 ^A0R, 38, 30  ^FD9406 1098 9864 4001 5644 84^FS

^FO 516, 49 ^A0R, 30, 30  ^FD^FS ^FX Registered Mail Service
^FO 516, 329 ^A0R, 30, 30  ^FD^FS ^FX Priority Mail Service
^FO 96, 505 ^A0R, 30, 30  ^FD^FS ^FX Return Receipt
^FO 56, 304 ^A0R, 30, 30  ^FD^FS ^FX Special Handling
^FO 96, 304 ^A0R, 30, 30  ^FD^FS ^FX Restricted Delivery
^FO 56, 44 ^A0R, 30, 30  ^FD^FS ^FX Signature Confirmation
^FO 96, 44 ^A0R, 30, 30  ^FD^FS ^FX Usps Tracking

^FO 40,15^GB 590, 600, 2B^FS 
^FO 40,615^GB 387, 570, 2B^FS
^FO 185,15^GB 0, 1170, 2B^FS
^FO 425,15^GB 0, 600, 2B^FS
^FO 502,15^GB 0, 600, 2B^FS
^FO 563,15^GB 0, 600, 2B^FS
^FO 563,325^GB 65, 0, 2B^FS
^FO 40,900^GB 145, 0, 2B^FS
^FO 110,615^GB 0, 285, 2B^FS
^FO 100,40^GB 25, 25, 2B^FS
^FO 60,40^GB 25, 25, 2B^FS
^FO 100,300^GB 25, 25, 2B^FS
^FO 60,300^GB 25, 25, 2B^FS
^FO 100,500^GB 25, 25, 2B^FS
^FO 520,45^GB 25, 25, 2B^FS
^FO 520,325^GB 25, 25, 2B^FS

^FO 0,0^GB 778, 1196, 2B^FS 
^LH0
^XZ
|^|^XA
^LH12,12
^LL1218

^FO 10, 20 ^AQR^FDPS Form 3816 January 2014 Facsimile^FS
^FO 10, 970 ^AQR^FDCopy 4 - Mailing P.O.^FS
^FO 150, 910 ^A0R, 28, 20  ^FDPostmark^FS 
^FO 150, 630 ^A0R, 28, 20  ^FDCOD Fee^FS 
^FO 115, 650 ^A0R, 38, 30  ^FD$6.65^FS
^FO 80, 630 ^A0R, 28, 20  ^FDPostage^FS
^FO 40, 650 ^A0R, 38, 30  ^FD$13.36^FS
^FO 150, 30 ^A0R, 28, 20  ^FDCheck and Enter Amount (If Applicable)^FS
^FO 100, 75 ^A0R, 28, 20  ^FDUSPS Tracking^FS
^FO 60, 75 ^A0R, 28, 20  ^FDSignature Confirmation^FS
^FO 100, 335 ^A0R, 28, 20  ^FDRestricted Delivery^FS
^FO 60, 335 ^A0R, 28, 20  ^FDSpecial Handling^FS
^FO 110, 535 ^A0R, 28, 20  ^FDReturn^FS
^FO 85, 535 ^A0R, 28, 20  ^FDReceipt^FS
^FO 60, 490 ^A0R, 28, 20  ^FDAmt^FS
^FO 35, 530 ^A0R, 38, 30  ^FD$0.00^FS
^FO 375, 45 ^A0R, 28, 20  ^FDFROM:^FS
^FO 350, 105 ^A0R, 28, 20  ^FDJames^FS
^FO 320, 105 ^A0R, 28, 20  ^FDPB^FS
^FO 290, 105 ^A0R, 28, 20  ^FD37 Executive Dr^FS
^FO 260, 105 ^A0R, 28, 20  ^FDBerwick ME 03901^FS
^FO 230, 105 ^A0R, 28, 20  ^FD^FS
^FO 200, 105 ^A0R, 28, 20  ^FD^FS
^FO 375, 645 ^A0R, 28, 20  ^FDTO:^FS
^FO 350, 705 ^A0R, 28, 20  ^FDJohn Smith^FS
^FO 320, 705 ^A0R, 28, 20  ^FD1 Union Ave^FS
^FO 290, 705 ^A0R, 28, 20  ^FDDanbury CT 06810-5953^FS
^FO 260, 705 ^A0R, 28, 20  ^FD^FS
^FO 230, 705 ^A0R, 28, 20  ^FD^FS
^FO 200, 705 ^A0R, 28, 20  ^FD^FS
^FO 465, 35 ^A0R, 28, 20  ^FDDate of Mailing^FS
^FO 435, 65 ^A0R, 28, 20  ^FD05/21/2016^FS
^FO 515, 75 ^A0R, 28, 20  ^FDRegistered Mail Service^FS
^FO 515, 355 ^A0R, 28, 20  ^FDPriority Mail Express Service^FS
^FO 595, 30 ^A0R, 28, 20  ^FDCheck/MO^FS
^FO 570, 30 ^A0R, 28, 20  ^FDAmount^FS
^FO 585, 150 ^A0R, 28, 20  ^FD$500.00^FS
^FO 595, 335 ^A0R, 28, 20  ^FDCash^FS
^FO 570, 335 ^A0R, 28, 20  ^FDAmount^FS
^FO 585, 480 ^A0R, 28, 20  ^FD$500.00^FS
^FO 655, 25 ^A0R, 38, 30  ^FD^FS
^FO 695, 25 ^A0R, 48, 40  ^FDRetain at Mailing Post Office^FS
^FO 450, 950 ^ASR, 120,100  ^FDCOD^FS
^BY2,3.0^FS
^FO 640, 675 ^BCR,80,N,N,N,N^FH^FD>;>842006810>89406109898644001564484^FS
^FO 580, 725 ^A0R, 38, 30  ^FD9406 1098 9864 4001 5644 84^FS

^FO 516, 49 ^A0R, 30, 30  ^FD^FS ^FX Registered Mail Service
^FO 516, 329 ^A0R, 30, 30  ^FD^FS ^FX Priority Mail Service
^FO 96, 505 ^A0R, 30, 30  ^FD^FS ^FX Return Receipt
^FO 56, 304 ^A0R, 30, 30  ^FD^FS ^FX Special Handling
^FO 96, 304 ^A0R, 30, 30  ^FD^FS ^FX Restricted Delivery
^FO 56, 44 ^A0R, 30, 30  ^FD^FS ^FX Signature Confirmation
^FO 96, 44 ^A0R, 30, 30  ^FD^FS ^FX Usps Tracking

^FO 40,15^GB 590, 600, 2B^FS 
^FO 40,615^GB 387, 570, 2B^FS
^FO 185,15^GB 0, 1170, 2B^FS
^FO 425,15^GB 0, 600, 2B^FS
^FO 502,15^GB 0, 600, 2B^FS
^FO 563,15^GB 0, 600, 2B^FS
^FO 563,325^GB 65, 0, 2B^FS
^FO 40,900^GB 145, 0, 2B^FS
^FO 110,615^GB 0, 285, 2B^FS
^FO 100,40^GB 25, 25, 2B^FS
^FO 60,40^GB 25, 25, 2B^FS
^FO 100,300^GB 25, 25, 2B^FS
^FO 60,300^GB 25, 25, 2B^FS
^FO 100,500^GB 25, 25, 2B^FS
^FO 520,45^GB 25, 25, 2B^FS
^FO 520,325^GB 25, 25, 2B^FS

^FO 0,0^GB 778, 1196, 2B^FS 
^LH0
^XZ

谢谢, Awadhendra

2 个答案:

答案 0 :(得分:1)

系统上的默认字符集应该有问题。试试这个,

StringUtils.newStringIso8859_1(Base64.decodeBase64(str.getBytes(StandardCharsets.UTF_8)))

您的JVM默认字符集应该不是UTF-8。在上面的代码中,UTF-8 Charset被传递

答案 1 :(得分:0)

您可以指定如何获取图像?如果它来自您控制的服务器,或来自返回图像的工件,则必须确保base64图像字符串中没有特殊字符。你可以使用例如Javascript函数encodeURIComponent()来做到这一点。如果您正在使用Java,可以查看此链接以查看其等效的Java equivalent to JavaScript's encodeURIComponent that produces identical output?