Android JNI warning:illegal Continuation byte 0xd2

Source: Internet
Author: User

  When you create a receive file name in SDcard, the following error is caused by a file name encoding problem.

 on- on  ,:Ten:11.054: W/DALVIKVM (1824): JNI warning:illegal Continuationbyte 0xd2 on- on  ,:Ten:11.054: W/DALVIKVM (1824):string:'???. Docx' on- on  ,:Ten:11.054: W/DALVIKVM (1824):inchLjava/io/file;. Listimpl (ljava/lang/string;) [ljava/lang/String; (NEWSTRINGUTF) on- +  -: -:39.573: I/DALVIKVM (566):"Main"prio=5Tid=1NATIVE on- +  -: -:39.573: I/DALVIKVM (566):   | group="Main"Scount=0Dscount=0obj=0x40997460self=0x12810 on- +  -: -:39.573: I/DALVIKVM (566):   | Systid=566Nice=0Sched=0/0cgrp=defaulthandle=1074082952 on- +  -: -:39.573: I/DALVIKVM (566):   | Schedstat= (334860174 892884911  the) utm= -stm= -Core=0 on- +  -: -:39.573: I/DALVIKVM (566): At Java.io.File.listImpl (Native Method) on- +  -: -:39.573: I/DALVIKVM (566): At Java.io.File.list (File.java:749) on- +  -: -:39.573: I/DALVIKVM (566): At Java.io.File.listFiles (File.java:791)

Find a possible solution on the Internet, modify the Checkjni.c file. But the feeling is not particularly reliable. It's not a good way to do it. By searching for related errors, I firmly believe that a string encoding problem should be the cause. In reference to this post, the perfect solution to this problem. This post link: https://groups.google.com/forum/#!topic/android-developers/y4lyEccZ--g

To provide a workaround in the post:

Convert this string to UTF-8 First,then call Newstringutf

Eg:filename=new String (Filename.getbytes (), "UTF-8");

Android JNI warning:illegal Continuation byte 0xd2

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.