Discussion Board

Results 1 to 5 of 5
  1. #1
    Super Contributor grahamhughes's Avatar
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,394
    Found on Asha 302.

    Code:
    String s = new String(aByteArray, "UTF-8");
    This appears to lose \ufeff characters encoded in the original data.

  2. #2
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    What happens on other devices? There is a bug-reporting set of pages available via "Contact and feedback", Series 40 bugs seem to be reported here: http://www.developer.nokia.com/bugs/...ct=Series%2040

  3. #3
    Super Contributor grahamhughes's Avatar
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,394
    Example code below.

    JME SDK emulator displays "feff 61 62 63", as do Series 60 devices, older Series 40s, other MIDP devices. I also see the same behaviour of String() on Java SE, Android and BlackBerry, so I regard this as "correct".

    The Asha 302 devices on Nokia RDA display only "61 62 63", as does (I now discover) my C3-01, so it has been a Series 40 issue for sometime.

    It is not causing me a problem, I'm just posting it for information.

    Code:
    import javax.microedition.midlet.MIDlet;
    import javax.microedition.lcdui.Form;
    import javax.microedition.lcdui.Command;
    import javax.microedition.lcdui.CommandListener;
    import javax.microedition.lcdui.Display;
    import javax.microedition.lcdui.Displayable;
    
    public class BomTest extends MIDlet implements CommandListener {
        protected void startApp() {
            Form f = new Form("BomTest");
            try {
                String s = new String("\ufeffabc".getBytes("UTF-8"), "UTF-8");
                for (int i = 0; i < s.length(); i++) {
                    f.append(Integer.toString((int) s.charAt(i), 16));
                }
            } catch (Exception e) {
                f.append(e.toString());
            }
            f.addCommand(new Command("Exit", Command.EXIT, 0));
            f.setCommandListener(this);
            Display.getDisplay(this).setCurrent(f);
        }
    
        public void commandAction(Command c, Displayable d) {
            notifyDestroyed();
        }
    
        protected void pauseApp() {
        }
        protected void destroyApp(boolean must) {
        }
    }

  4. #4
    Nokia Developer Champion Tiger79's Avatar
    Join Date
    Apr 2007
    Posts
    2,697
    thanks for sharing Graham !
    Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them.

  5. #5
    Super Contributor grahamhughes's Avatar
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,394
    My pleasure!

    Guess who needs a new phone...

    (kidding!)

Similar Threads

  1. takes two string form user and show the concatenated string result in new dialog box
    By swaraj.prasad@gmail.com in forum Symbian User Interface
    Replies: 3
    Last Post: 2011-03-17, 10:27
  2. Replies: 2
    Last Post: 2010-09-03, 21:12
  3. how to compress valuse which is stored in String buffer or string
    By vinoy_george99 in forum Mobile Java General
    Replies: 4
    Last Post: 2009-09-02, 06:08
  4. Check the existence of a string in a string pool (table)
    By moldovan_catalin in forum Symbian C++
    Replies: 4
    Last Post: 2008-11-30, 22:30
  5. Replies: 5
    Last Post: 2006-02-26, 17:29

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved