Displaying  arabic using j2me

hi every body,
my experience with j2me is very little and i need to display arabic text
i am using eclipse and carbide j1.5
i searched the forum and i found that writing the following should work
String s=new String("arabic_string".getBytes(), "UTF-8");
but when i display s it appears like ????
i used
String en= System.getProperty("microedition.encoding");
String lc= System.getProperty("microedition.locale");
the ecoding is ISO8859-1
and the locale is en or ar according to the setting of the phone language
i am testing on deviced nokia n73 and nokia 6630
i got the same output with the 2 device
urgent help is required plz
and if any body has a sample code that would be great
thanks

salam raghda ,
I am experience with arabic text. i use also eclipse
this is what you need :
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.io.UnsupportedEncodingException;
import java.sql.SQLException;
public class font {
public static void main(String[] args) {
String word_temp="�������";
try {
word_temp = new String(word_temp.getBytes("utf8" ));
} catch (UnsupportedEncodingException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
System.out.println(word_temp);
any help you are welcome
Faraj

Similar Messages

  • Problem with Display.setCurrentItem() using J2ME-Polish

    Hi,
    I am fairly new to J2ME-polish and have encountered a situation that I am having a problem with. I am loading a form with a number of String Items. When I display the form I would like to focus to the last String Item that has been placed on the form. I have been using Display.setCurrentItem() in J2ME but when I try using it in J2ME-Polish I receive this message :"de.enough.polish.ui.Screen (3022): Screen: unable to focus item (did not find it in the container or is not activatable ) "
    Below is a snippet of my code.
            // si14 in a StringItem defined earlier in the code
            // It is the last stringItem placed into the form
            form.append(si14);
            display = Display.getDisplay(this);
         display.setCurrent(form);
         display.setCurrentItem(form.get(0));Thanks

    http://forums.sun.com/thread.jspa?threadID=686256&messageID=10864566

  • Problem displaying Arabic characters in PDF using Java APIs

    We are experiencing a problem when attempting to display Arabic characters within a PDF document using the Java APIs.
    The relevant Java code is as follows:
    RTFProcessor processor = new RTFProcessor("example.rtf" );
    processor.setOutput( “example.xsl” );
    processor.setExtractXLIFF(true);
    processor.process();
    ByteArrayOutputStream dataOut = new ByteArrayOutputStream();
    DataProcessor dataProcessor = new DataProcessor();
    dataProcessor.setDataTemplate( example.xdt" );
    if( parameterValues != null && parameterValues.length > 0 )
    setReportParameters( dataProcessor, parameterValues ); // method to set any report parameters from the parameterValues list.
    dataProcessor.setConnection( jdbcConnection );
    dataProcessor.setOutput(dataOut);
    dataProcessor.processData();
    FOProcessor foProcessor = new FOProcessor();
    foProcessor.setLocale( locale );
    foProcessor.setData( new ByteArrayInputStream( dataOut.toByteArray() ) );
    foProcessor.setTemplate( “example.xsl” );
    String xliffFileNameAndPath = getXLIFFFile( “example”, locale );
    if( xliffFileNameAndPath != null )
    foProcessor.setXLIFF( xliffFileNameAndPath );
    foProcessor.setOutput( "example.pdf" );
    foProcessor.setOutputFormat(
    outputFormat == PDF_FORMAT ? FOProcessor.FORMAT_PDF : FOProcessor.FORMAT_HTML );
    foProcessor.generate();
    The method getXLIFFFile( ) gets the relevant XLIFF file for the supplied report locale (if it exists) – the three test files that we used were Italian (example_it_IT.xlf), Spanish (example_es_ES.xlf) and Arabic (example_ar_AE.xlf).
    I imported the following JAR files from the XML Publisher release (version 5.6.2) into my Java application: collections.jar, i18nAPI_v3.jar, versioninfo.jar, xdocore.jar and xmlparserv2.jar.
    The output is OK for all three translations in HTML format, using a charset of UTF-8, and for Italian and Spanish in PDF format. However, the Arabic characters display as question marks in PDF format. The same issue occurs if I stream the output as a byte array straight to the HTTP response rather than save within a file.
    Note that the same RTF, XDT and XLIFF files produce the correct output in both HTML and PDF when executed within XMLPublisher.
    Thank you

    Hi
    I had a similar issue with arabic chars. With PDF layout, chars were appearing properly when preveiwd on local m/c, but as I implement file on server, it was displayed as ?????. I had raised a TAR 5798348.993 with oracle about this and they suggested to apply patch 4028294 Oracle Sourcing J Rollup and then patch 4182914. But later my users changed requirement and i cud not apply the patch to test if it works fine.
    But here, you have suggested that installing fonts would do. Is it really that simple? If yes, dont know what is that patch for which I was told to apply.
    Regards
    Varun

  • I want to run jasper Report as pdf to display arabic letter

    i want to run jasper Report as pdf to display arabic letter butv when i use
    byte[] bytes =JasperRunManager.runReportToPdf(report,parameters, conn); display ?????
    i hope anybody to help me
    thanks
    Edited by: Amr Ahmed on May 2, 2011 2:08 AM

    DECLARE
    vParamList PARAMLIST;
    BEGIN
    vParamList:=GET_PARAMETER_LIST('MyRep');
    IF NOT ID_NULL(vParamList) THEN
    DESTROY_PARAMETER_LIST(vParamList);
    END IF;
    vParamList:=CREATE_PARAMETER_LIST('MyRep');
    SET_REPORT_OBJECT_PROPERTY('report_path\emp_rep_def',REPORT_DESFORMAT,'PDF');
    RUN_PRODUCT(REPORTS,'report_path\emp_rep_def',ASYNCHRONOUS,RUNTIME,FILESYSTEM,vParamList,NULL);
    END;

  • Problem in displaying Arabic Character in Paper Layout

    Hi
    I am facing problem while displaying arabic characters.
    In Web layout i am able to get it by changing the character set to ISO-8259-6.
    I had changed the NLS parameters in registry as suggested in the help. But still i am unable to get. Please can anyone send the brief steps to fix this.
    Thanks in Advance
    Ranganath

    Ranganath,
    That means subsetting is not happening. If subsetting had been successful, you would have seen in "Font properties", the type of font as Type 3 and name of the font as Fx, where x could be 0,1 etc.
    The things I suspect are: 1) your report definition has some other font associated which is not Arial.
    2) You are not specifying correctly the subset information in uifont.ali.
    Open your report in builder and check again, what font you are using to display the data. Open the report in paper layout and click on the data field and check in the font box, the font name that is displayed.
    In your uifont.ali, make sure that under [PDF:Subset] section, you specify (if you are using Arial font)
    Arial = "arial.ttf".
    If you have any other entry regarding Arial in other sections of uifont.ali, comment those for the time being by putting # before those.
    Let me know the font properties after these steps.

  • Displaying Arabic in PDF report generated by Report viewer

    Dear all,
    we are using oracle developer suite 6i 32 bit on oracle database 10gR2 32 bit on windows server 2008.
    we have a problem with displaying Arabic in our pdf file which is generated from the report.
    details are below
    1. our database NLS details are below
    select * from v$nls_parameters
    PARAMETER                                          VALUE
    NLS_LANGUAGE                                       AMERICAN
    NLS_TERRITORY                                      AMERICA
    NLS_CURRENCY                                       $
    NLS_ISO_CURRENCY                                   AMERICA
    NLS_NUMERIC_CHARACTERS                             .,
    NLS_CALENDAR                                       GREGORIAN
    NLS_DATE_FORMAT                                    DD-MON-RR
    NLS_DATE_LANGUAGE                                  AMERICAN
    NLS_CHARACTERSET                                   AR8ISO8859P6
    NLS_SORT                                           BINARY
    NLS_TIME_FORMAT                                    HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT                               DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT                                 HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT                            DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY                                  $
    NLS_NCHAR_CHARACTERSET                             AL16UTF16
    NLS_COMP                                           BINARY
    NLS_LENGTH_SEMANTICS                               BYTE
    NLS_NCHAR_CONV_EXCP                                FALSE
    2. our registry details are below
    NLS_Lang=ARABIC_AMERICA.AR8MSWIN1256
    3. our operating system details are below
    System Language= Arabic Oman
    4. PDF Viewer is Adobe Acrobat Reader
    now here is the problem
    when we generate the report, the report viewer display the report and the Arabic is displayed as expected.
    but when we click on File>Generate to File>PDF
    the file is created, but the contents of the file are in unknown format, it is neither English nor Arabic.
    if we click on File>Generate to File>RTF
    then the Arabic is displayed correctly, but it is not what we need. we need to display it in ADOBE ACROBAT or FOXIT READER for example.
    How to fix it?
    kindly guide us accordingly.
    Regards

    any help please?

  • How to display Arabic content in JSP ?

    Hi all,
    I used the following encoding method to display arabic content in JSP page.
    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
    <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
    I also set -Dfile encoding=ISO-8859-6 in the JVM Options.As a result the arabic data is getting displayed .
    Variable "data" contains the actual arabic data.
    function updateArabicData(data){
    try{
    document.getElementById('divtag').innerHTML=""+data;
    }catch(err){
    <html>
    <body>
    <div id="divtag" lang="ar-sa"></div>
    </body>
    </html>
    But the problem is the arabic data getting displayed in JSP (within the <div>)seems to be jumbled up.The users say that the arabic words within a single sentence are not arranged correctly.They are mixed up.Please help me with a solution.
    Edited by: Alance on May 27, 2010 5:34 AM

    Data is retrieved as follows
    if(msg.getField("GEN_UNICODE_MESSAGE_1")!=null){
    resultString=resultString+"N"+""+new String((byte[])msg.getField("GEN_UNICODE_MESSAGE_1").value.get(0),"ISO-8859-6");
    with content Type set as response.setContentType("text/html;charset=ISO-8859-6");
    ISO-8859-6 -since the data contains arabic news.
    Edited by: Alance on May 27, 2010 11:05 PM

  • LOCATION FINDING without using GPS using J2ME (in gsm network)

    I was wondering if it is possible for me to obtain the ID (name) of the tower my phone is communicating with using J2ME (in a GSM network). I`m developing for T610. The cell info display shows the name of the tower. Is there any way i can get that text into my java program? I`ve seen Nokia apps do it, but they are C++ apps.. Is the same thing possible with J2ME?

    Hi,
    Yes it is possible. Try to use receive CBS messages it will give you the location name. And moreover there are some handset model specific that you have to use. I was successful in doing the same for motorola devices.
    System.getProperty("IMSI")
    System.getProperty("CellID")
    System.getProperty("LocAreaCode")
    This will give you imsi, cellid and location area code and then try to receive cbs messages that will give you the location.
    It has been successfully implemented on motorola device
    Bye
    Sunil

  • How to view web page in emulator/device using j2me

    hi
    i wanna view web page using j2me
    i am using code ----instead of getting teh page i am getting source code of the page and i am not getting any thing in real device so do i need a browser??cant i view this page inside my application??
    HttpConnection connection = null;
         InputStream inputstream = null;
         try
              this.platformRequest("http://www.lntinfotech.com");
              /* System.out.println("aaaaaaaaaaa11");
         connection = (HttpConnection) Connector.open("http://www.lntinfotech.com");
         System.out.println("aaaaaaaaaaa112");
         //HTTP Request
         connection.setRequestMethod(HttpConnection.GET);
         System.out.println("aaaaaaaaaaa113");
         connection.setRequestProperty("Content-Type","//text plain");
         System.out.println("aaaaaaaaaaa1133");
         connection.setRequestProperty("Connection", "close");
         System.out.println("aaaaaaaaaaa11444");
         // HTTP Response
         System.out.println("Status Line Code: " + connection.getResponseCode());
         System.out.println("Status Line Message: " + connection.getResponseMessage());
         if (connection.getResponseCode() == HttpConnection.HTTP_OK)
              this.platformRequest("http://www.google.com");
              System.out.println("aaaaaaaaaaa11444555");
         System.out.println(
         connection.getHeaderField(0)+ " " + connection.getHeaderFieldKey(0));
         System.out.println(
         "Header Field Date: " + connection.getHeaderField("date"));
         String str;
         inputstream = connection.openInputStream();
         int length = (int) connection.getLength();
         if (length != -1)
         byte incomingData[] = new byte[length];
         inputstream.read(incomingData);
         System.out.println("aaaaaaaaaaa1144555");
         str = new String(incomingData);
         else
         ByteArrayOutputStream bytestream =
         new ByteArrayOutputStream();
         int ch;
         while ((ch = inputstream.read()) != -1)
         bytestream.write(ch);
         str = new String(bytestream.toByteArray());
         bytestream.close();
         System.out.println(str);
         }

    instead of getting teh page i am getting source code of the page and i am not getting any thing in real device so do i need a browser??Yes.
    cant i view this page inside my application??Not unless you can write a browser component to parse and display the HTML. (you can't, it's too big a job)
    db

  • How to record an audio using j2me

    hello i'm new to this.
    i have some sample code to record audio in wireless toolkit
    but i got error in "setOutputStream()"
    this is my code.any one help me....................
    code :-
    ====
    try
    // create the Player object using amr encoding
    p = Manager.createPlayer("capture://audio?encoding=pcm");
    p.realize();
    // get the RecordControl over this Player
    RecordControl rc = (RecordControl)p.getControl("RecordControl");
    // create an OutputStream which the RecordControl will use
    // to write write the recorded data.
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    rc.setRecordStream(output);
    // start the recording
    rc.startRecord();
    p.start();
    messageItem.setText("recording...");
    Thread.currentThread().sleep(5000); // record for 5 seconds
    messageItem.setText("done!");
    rc.commit();
    // save the recordedData in a byte array
    recordedSoundArray = output.toByteArray();
    // close the player
    p.close();
    } //try
    catch (IOException ioe)
    errorItem.setLabel("Error");
    errorItem.setText(ioe.toString());
    catch (MediaException me)
    errorItem.setLabel("Error");
    errorItem.setText(me.toString());
    catch (InterruptedException ie)
    errorItem.setLabel("Error");
    errorItem.setText(ie.toString());
    }//if

    hai all,
    im new here ..i have problem in recording audio using j2me..my code is as below
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.media.control.RecordControl;
    import javax.microedition.media.Manager;
    import javax.microedition.media.MediaException;
    import javax.microedition.media.Player;
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    public class recordMidlet extends MIDlet implements CommandListener
    private Form init = new Form("info");
    private Command rec = new Command("rec",Command.OK, 1),
    stop = new Command("stop",Command.STOP, 0),
    exit = new Command("exit",Command.EXIT, 0);
    private byte[] recordedSoundArray;
    private Player p;
    private RecordControl rc;
    private ByteArrayOutputStream output;
    public void startApp()
    init.addCommand(rec);
    init.addCommand(stop);
    //init.addCommand(exit);
    init.setCommandListener(this);
    Display.getDisplay(this).setCurrent(init);
    public void pauseApp()
    public void destroyApp(boolean unconditional)
    public void commandAction(Command com, Displayable dis)
    if(com == exit)
    notifyDestroyed();
    else if(com == stop)
    init.removeCommand(stop);
    init.addCommand(exit);
    try
    init.append("finish record... starting playback\n\n");
    rc.stopRecord();
    rc.commit();
    p.stop();
    p.close();
    init.append("playing...\n");
    recordedSoundArray = output.toByteArray();
    init.append("recorded sound = " +String.valueOf(recordedSoundArray.length)+"\n\n");
    ByteArrayInputStream recordedInputStream = new ByteArrayInputStream(recordedSoundArray);
    Player p2 = Manager.createPlayer(recordedInputStream,"audio/x-wav");
    p2.prefetch();
    p2.start();
    //init.append("finish playing...");
    catch (Exception e) {
    init.append("stop command: "+e.toString());
    else if(com == rec) {
    try {
    init.append("record voice ...\n\n");
    // Create a Player that captures live audio.
    p = Manager.createPlayer("capture://audio?encoding=pcm&rate=8000&bits=16");
    p.realize();
    // Get the RecordControl, set the record stream,
    rc = (RecordControl)p.getControl("RecordControl");
    output = new ByteArrayOutputStream();
    rc.setRecordStream(output);
    rc.startRecord();
    p.start();
    } catch (Exception ioe)
    init.append(ioe.toString());
    i get error from ktoolbar window..
    Warning: To avoid potential deadlock, operations that may block, such as
    networking, should be performed in a different thread than the
    commandAction() handler.
    Emulator is not working after that..and it jus shows text
    " RecordMidlet wants to record an audio clip.is it ok to record? then the emulator hangs..
    could someone help me to solve this problem..is there any setting problems in j2me wireless toolkit ?
    im using J2me wireless toolkit 2.5 for CLDC beta 2 .
    thanks to all.

  • Access webmail using J2me

    i am new to j2me, i need to do a project using j2me( need to access the webmail.)
    login to the webmail (for eg.gmail).
    display the inbox, outbox, and compose mail.
    display contacts, calendar.
    upload or download attachments.
    Can u suggest some link or tutorials for reference.... or any tips regrading this topic........ will be very helpful.......... Thank you!
    and approximately how long will it take to finish this project?

    Ineedtoknow wrote:
    The screen is nearly blank, and at the bottom it sometimes says error on page.  After spending over 90 minutes working with me, the technician acknowledged that the problem is with Verizon.  Hoping they come up with a solution soon
    Have you tried using Compatibility View? If you have the button enabled it should be at the end of your address bar just before the Refresh button, looks like a ripped page. If you don't have the button enabled, you can turn it Compatibility View through the Tools menu.
    I'm not having any issues, but I know that doesn't help you much.
    If a forum member gives an answer you like, give them the Kudos they deserve. If a member gives you the answer to your question, mark the answer as Accepted Solution so others can see the solution to the problem.
    "All knowledge is worth having."

  • How can I display and use the full RAW file?

    Hi,
    my camera (Canon S95) has a sensor with 4:3 aspect ratio and thus saves all RAW files in this format. Additionally, the camera can automatically create JPGs with a cropped ratio (e.g. 3:2 or 16:9). This is very helpful because you can see the target format already on the camera screen (with black bars on top and bottom), which helps the composition. However, when processing the photos on the big screen afterwards, it often also helps the photo to adjust the ratio a little bit and therefore use the additional information saved in the bigger 4:3 RAW file. This works very well with many of the freely available software tools.
    The problem found in Lightroom is now that it only shows the RAW photo in the cropped format and up to know I have found no way to display or use the full RAW format. So my question is: Which settings do I have to change to use the full format? What do I need to change?
    Searching a little bit on the web I found many other photographes having the exactly same problem with many different cameras. However none of them reported to have a solution for this. Still I am pretty sure that there must be a solution, since otherwise this would be a really heavy bug within Lightroom and I cannot imagine that Adobe would leave this matter unsolved.
    So I would really appreciate if someone could help me with this.
    Many Thanks
    Martin

    Hi Jao, Victoria, Lee Jay,
    Thanks for clearification. Do you have additional information about when this fix will be available and whether at least some popular old cameras will be supported?
    What I do not get is why Adobe would need to redo all existing cameras. I think this is a more general issue, where Lightroom misinterpretes the exif data which includes both the exif image height/width as well as the cropped image height/width. Intepreting this information correctly, any software should be able to display both - the full image and the cropped area (as shown by many cheap or free software tools). In the internet I found another workaround for the issue in Lightroom, which is undermining this point: When setting the cropped image height/width to the numbers of exif image height/width manually (e.g. with exif tools), Lightroom actually is able to display the full 4:3 picture.
    So this bug should be easily fixed for all cameras and I have no clue why Adobe still has no fixed it with Lightroom already available in version 4.2.
    Cheers
    Martin

  • Is there a way to select which display to use??

    Hi,
    I think my problem is OS dependent but i'm still gonna ask...
    Code related to this problem is:
      Process runner;
      Runtime t = Runtime.getRuntime();
      runner = t.exec("<path-to-office>\powerpnt.exe /s '<path-to-show>\show.ppt'");
      //  The program in line above is not nessecary  powerpoint it can be also Acrobat or web browser!!
      // (basicly  anythig which can be run on full-screen mode from command line)
    The Problemo:
    I have a computer (running on Win XP) which has two (or more) displays attached (Matrox G550),
    do i have a chance to detect amount of displays and if there is more than one display, can i somehow
    select in Runtime which display to use to show results of code above?
    Matrox solution was "when you run program once in certain display , it should be opened in same
    display next time", well... what if i shoud use 2 powerpoints in same time to have x kind of ppt in one
    screen and y kind in second screen wich has totally different kind of info what screen x does?
    If it's possible with JFrame to decide wich screen to use, i'm almost shure that i can change program to
    use pictures instead of external programs.
    -jori

    Hmm, I don't know how you would do this with out going native, but for Java frames you can use the following links.
    http://java.sun.com/j2se/1.4.2/docs/api/java/awt/GraphicsDevice.html
    http://openide.netbeans.org/multi-monitors.html

  • TS1456 My 4th Gen iPod Nano isn't displaying a "Use iTunes to restore" message, but iTunes is displaying a restore message when I connect it. I have original music that I can't back up on my iPod. Is there any way that I can fix the iPod without restoring

    My 4th Gen iPod Nano isn't displaying a "Use iTunes to restore" message, but iTunes is displaying a restore message when I connect it. I have original music that I can't back up on my iPod. Is there any way that I can fix the iPod without restoring it?

    It's not designed to work like this. When you sync, the iPod stores some information that basically says 'this iPod belongs to computer xyz'. Apple did this to prevent copyright issues (syncing someone else's music).
    If you really want to do this, you'll have to at least tie both iTunes installations to the same account. Maybe have them sync with each other.

  • I have an Apple Powerbook G4, and my monitor doesn't function. I have an external display Monitor, however it's stuck in extended screen mode. How do I get it to mirror or duplicate the display without use of the on-board?

    As i had said, I have an Apple Powerbook G4, and my monitor doesn't function. I have an external display Monitor, however it's stuck in extended screen mode. How do I get it to mirror or duplicate the display without use of the on-board? Is there a Fn key combo i'm missing or is the issue more serious then i realize? any and all help and hints would be greatly apprichiated, thanks in advance.
    -Powerbook User

    The PowerBooks have an F-key that toggles mirrored and extended mode. My PB is loaned out right now but I think it was f7. The keycap has an icon on two overlapping rectangles, as I recall.
    EDIT: Yes! Found a pdf of the PB manual it shows F7 is the toggle:

Maybe you are looking for