Note that there are some explanatory texts on larger screens.

plurals
  1. POinterpretation iso-8859-1
    primarykey
    data
    text
    <p>Good morning, I came across a problem that I do not understand, let me explain:</p> <p>I'm working on a project based on microcontroller Arduino and an Android app. The arduino recovers mails from pop3 commands and sends them to the Android application. The two communicate through SMS only.</p> <p>The problem is : I get messages on Android via SMS Broadcaster to recover then a string (String).</p> <p>Here is an example of mail recovered object:</p> <blockquote> <p>Re: [Stage] techniques =?iso-8859-1?Q?vari?= =?iso-8859-1?B?6WVz?=de communication</p> </blockquote> <p>This gives the following result:</p> <blockquote> <p>Re: [Stage] techniques variées de communication</p> </blockquote> <p>It may be noted that only some pieces of text are coded in ISO, in two different ways it seems.</p> <p>My question is: How can i parse the text ? The problem is that using the SMS transmission I did not choose the type of return. Here is the code I use to read a text message:</p> <pre><code>Bundle bundle = intent.getExtras(); if (bundle != null) { Object[] pdus = (Object[])bundle.get("pdus"); SmsMessage[] message = new SmsMessage[pdus.length]; String messageBody = null; String phoneNumber = null; for (int i=0; i&lt; message.length;i++) { message[i] = SmsMessage.createFromPdu((byte[])pdus[i]); } messageBody = message[0].getMessageBody(); phoneNumber = message[0].getDisplayOriginatingAddress(); if (message.length &gt; -1) { if (phoneNumber.equals(arduino)) { Toast.makeText(context, "New Data",Toast.LENGTH_SHORT ).show(); //this.abortBroadcast(); Log.d("BroadcastSMS", "***************phoneNumber:"+phoneNumber+" messageBody:"+messageBody); //TODO : ici, que faire du message "messageBody" pour l'interpréter. } } } </code></pre> <p>I find myself already with a message as a String. My instinct was to try to code myself a "shell" but I do not understand how are coded "ed" in this example. Clarify my questions are:</p> <ul> <li><p>What is the difference between 'Q' and 'B' in the tag ISO?</p></li> <li><p>In my example the second tag should ISO code "ed" (note the space, if the words are glued). But I'm not in a case of correspondence between a hexadecimal code [0-F] [0-F] for the text is: 6WVz</p></li> </ul> <p>But I may be on the wrong way, if you have an answer to these questions or an other method can you help me ?</p> <p>Thank you in advance anyway.</p> <p>JM</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload