久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何修復 1 字節(jié) UTF-8 序列的無效字節(jié) 1

How to fix Invalid byte 1 of 1-byte UTF-8 sequence(如何修復 1 字節(jié) UTF-8 序列的無效字節(jié) 1)
本文介紹了如何修復 1 字節(jié) UTF-8 序列的無效字節(jié) 1的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在嘗試使用 java 方法從 db 中獲取以下 xml,但出現(xiàn)錯誤

I am trying to fetch the below xml from db using a java method but I am getting an error

用于解析 xml 的代碼

Code used to parse the xml

DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();

InputSource is = new InputSource(new ByteArrayInputStream(cond.getBytes()));

Document doc = db.parse(is);

Element elem = doc.getDocumentElement();

// here we expect a series of <data><name>N</name><value>V</value></data>
NodeList nodes = elem.getElementsByTagName("data");

TableID jobId = new TableID(_processInstanceId);
Job myJob = Job.queryByID(_clientContext, jobId, true);

if (nodes.getLength() == 0) {
    log(Level.DEBUG, "No data found on condition XML");

}

for (int i = 0; i < nodes.getLength(); i++) {
    // loop through the <data> in the XML

    Element dataTags = (Element) nodes.item(i);
    String name = getChildTagValue(dataTags, "name");
    String value = getChildTagValue(dataTags, "value");

    log(Level.INFO, "UserData/Value=" + name + "/" + value);

    myJob.setBulkUserData(name, value);
}

myJob.save();

數(shù)據(jù)

<ContactDetails>307896043</ContactDetails>
<ContactName>307896043</ContactName>
<Preferred_Completion_Date>
</Preferred_Completion_Date>
<service_address>A-End Address: 1ST HELIERST HELIERJT2 3XP832THE CABLES 1 POONHA LANEST HELIER JE JT2 3XP</service_address>
<ServiceOrderId>315473043</ServiceOrderId>
<ServiceOrderTypeId>50</ServiceOrderTypeId>
<CustDesiredDate>2013-03-20T18:12:04</CustDesiredDate>
<OrderId>307896043</OrderId>
<CreateWho>csmuser</CreateWho>
<AccountInternalId>20100333</AccountInternalId>
<ServiceInternalId>20766093</ServiceInternalId>
<ServiceInternalIdResets>0</ServiceInternalIdResets>
<Primary_Offer_Name  action='del'>MyMobile Blue &#163;44.99 [12 month term]</Primary_Offer_Name>
<Disc_Reason  action='del'>8</Disc_Reason>
<Sup_Offer  action='del'>80000257</Sup_Offer>
<Service_Type  action='del'>A-01-00</Service_Type>
<Priority  action='del'>4</Priority>
<Account_Number  action='del'>0</Account_Number>
<Offer  action='del'>80000257</Offer>
<msisdn  action='del'>447797142520</msisdn>
<imsi  action='del'>234503184</imsi>
<sim  action='del'>5535</sim>
<ocb9_ARM  action='del'>false</ocb9_ARM>
<port_in_required  action='del'>
</port_in_required>
<ocb9_mob  action='del'>none</ocb9_mob>
<ocb9_mob_BB  action='del'>
</ocb9_mob_BB>
<ocb9_LandLine  action='del'>
</ocb9_LandLine>
<ocb9_LandLine_BB  action='del'>
</ocb9_LandLine_BB>
<Contact_2>
</Contact_2>
<Acc_middle_name>
</Acc_middle_name>
<MarketCode>7</MarketCode>
<Acc_last_name>Port_OUT</Acc_last_name>
<Contact_1>
</Contact_1>
<Acc_first_name>.</Acc_first_name>
<EmaiId>
</EmaiId>

錯誤

 org.apache.xerces.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence.

我在一些線程中讀到這是因為 xml 中的一些特殊字符.如何解決這個問題?

I read in some threads it's because of some special characters in the xml. How to fix this issue ?

推薦答案

如何解決這個問題?

How to fix this issue ?

使用正確的字符編碼讀取數(shù)據(jù).錯誤消息意味著您正在嘗試以 UTF-8 格式讀取數(shù)據(jù)(有意或因為這是未指定 <?xml version="1.0" encoding="somethingelse 的 XML 文件的默認編碼"?>) 但它實際上采用不同的編碼,例如 ISO-8859-1 或 Windows-1252.

Read the data using the correct character encoding. The error message means that you are trying to read the data as UTF-8 (either deliberately or because that is the default encoding for an XML file that does not specify <?xml version="1.0" encoding="somethingelse"?>) but it is actually in a different encoding such as ISO-8859-1 or Windows-1252.

為了能夠建議您應該如何執(zhí)行此操作,我必須查看您當前用于讀取 XML 的代碼.

To be able to advise on how you should do this I'd have to see the code you're currently using to read the XML.

這篇關于如何修復 1 字節(jié) UTF-8 序列的無效字節(jié) 1的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權益,請聯(lián)系我們刪除處理,感謝您的支持!

相關文檔推薦

Upload progress listener not fired (Google drive API)(上傳進度偵聽器未觸發(fā)(Google 驅動器 API))
Save file in specific folder with Google Drive SDK(使用 Google Drive SDK 將文件保存在特定文件夾中)
Google Drive Android API - Invalid DriveId and Null ResourceId(Google Drive Android API - 無效的 DriveId 和 Null ResourceId)
Google drive api services account view uploaded files to google drive using java(谷歌驅動api服務賬戶查看上傳文件到谷歌驅動使用java)
Google Drive service account returns 403 usageLimits(Google Drive 服務帳號返回 403 usageLimits)
com.google.api.client.json.jackson.JacksonFactory; missing in Google Drive example(com.google.api.client.json.jackson.JacksonFactory;Google Drive 示例中缺少)
主站蜘蛛池模板: 成人高清在线视频 | 久久精品毛片 | 日韩一级 | 天天天操 | 国产精品1区2区3区 中文字幕一区二区三区四区 | 亚洲精品影院 | 国产精品久久久久久久久久妇女 | 精品久久电影 | 日本一区二区高清不卡 | 福利视频网站 | 精品中文字幕一区二区三区 | 亚洲www啪成人一区二区 | 久久国产精品免费一区二区三区 | 福利二区 | 韩日一区二区三区 | 午夜一级做a爰片久久毛片 精品综合 | 久久一区二区三区免费 | 色视频在线播放 | 欧美日韩一区二区在线 | 国产一区欧美 | 欧美日本免费 | 成人三区| 你懂的国产 | 午夜欧美| 毛片网站在线观看 | 一区视频在线免费观看 | 国产在线中文字幕 | 午夜精品久久久久久久久久久久久 | 99热在线播放 | 日韩免费网站 | 精品国产乱码 | 久久精品亚洲欧美日韩精品中文字幕 | 国产一区二区a | 亚洲成人在线网 | 欧美一区二区 | 久久精品一区二区三区四区 | 狠狠干网| 国产精品99久久久久久久久久久久 | 国产精品色婷婷久久58 | 欧美激情久久久 | 亚洲一区三区在线观看 |