khi tôi đọc dữ liệu từ API luồng của twitter và sau đó ghi vào xmlfile.Giải mã & # 55357; đến ký tự thực
Nhưng một số ký tự đặc biệt như �
sẽ gây ra lỗi (Ý tôi là khi tôi mở rằng xmlFile trong Chrome, Chrome nói rằng có một lỗi ở nhân vật mà!)
Tôi muốn chuyển đổi mà chuỗi mã hóa (�
) thành ký tự thực (& # 55357;) trước khi ghi vào xmlfile!
Cách triển khai tính năng này?
------------- THÊM --------------
Đây là nội dung xmlFile:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<text>@carlyraejepsen would be a dream if you follow me, please follow me?, I love you so much you're my inspiration</text>
<text>someone please bring me a caramel apple and a mocha from black cat. i'll love you forever</text>
<text>“@G_MartinFlyKick: Marry me Juliet.I love you and that's all I really know.”����������</text>
<text>"I need to see a picture of him cuz Im trying to imagine you guys making love and all I see is u climbing on top of a big question mark"lmao</text>
<text>@District3music hi, I LOVE YOU follow me please? &lt;3 xx 23</text>
<text>RT @syardley_: So appreciative of my family and people I love, wouldn't be where I am without them. #thankful</text>
<text>#DISTRICT3HALLOWEENFOLLOWSPREE #DISTRICT3HALLOWEENFOLLOWSPREE #3EEKERFROMTHENETHERLANDS love you! Please follow ? @District3music x42</text>
<text>Arguably my favorite electronic music producer @Kluteuk is coming back to Toronto on Dec 22nd. So stoked. Guy has made so many tunes I LOVE.</text>
<text>The stakes are high, the water's rough, but this love is ours.</text>
<text>@NiallOfficial Answer me, I love you very much. Venezuela loves. jhgj</text>
<text>Love this shit http://t.co/qSP79NKx</text>
</root>
Và đây là lỗi từ Chrome:
This page contains the following errors:
error on line 5 at column 91: xmlParseCharRef: invalid xmlChar value 55357
Below is a rendering of the page up to the first error.
Bạn đang sử dụng ngôn ngữ/khuôn khổ nào? .MẠNG LƯỚI? C? 6502 assembler? –
Lỗi nói gì? Vui lòng cho chúng tôi biết XML. – SLaks
Tôi đang sử dụng Java @DourHighArch – Songokute