Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to read Unicode and UTF-8 Encoding File in J2ME

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article shows you how to read Unicode and UTF-8 encoded files in J2ME. The content is concise and easy to understand. It will definitely make your eyes shine. I hope you can gain something from the detailed introduction of this article.

J2ME has a more diverse environment and goals than J2SE and J2EE, but each product has a more singular purpose and stricter resource constraints.

Reading Unicode and UTF-8 encoded files in J2ME

J2ME reads Unicode files

/** * Read Unicode encoded text files *@paramresourceString-filename *@returnString-Unicode text */ publicstaticStringread_Uni(Stringresource){ byteword_uni[]=newbyte[1024]; StringStrReturn=null; InputStreamis; try{ is=instance.getClass().getResourceAsStream(resource); is.skip(2);//Skip two-byte headers is.read(word_uni); is.close(); StringBufferstringbuffer=newStringBuffer(""); for(intj=0;j

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 275

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report