Reading and displaying Korean Language

public class TestProgram extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
res.setContentType("text/plain; charset=EUC-KR");
PrintWriter out = res.getWriter();
res.setHeader("Content-Language", "ko");
Locale locale = new Locale("ko", "");
DateFormat full = DateFormat.getDateTimeInstance(DateFormat.LONG,
DateFormat.LONG,
locale);
out.println("In Korean:");
try {
FileInputStream fis =
new FileInputStream(req.getRealPath("/HelloWorld.ISO-2022-KR.doc"));
InputStreamReader isr = new InputStreamReader(fis, "ISO-2022-KR");
BufferedReader reader = new BufferedReader(isr);
String line = null;
while ((line = reader.readLine()) != -1) {
out.println(line);
catch (FileNotFoundException e) {
out.println(full.format(new Date()));
i had used these code for that ..........
i have stored Korean language in doc file .......but while displaying in browser i'm getting a lot of special characters and question marks displaying..........what should i do???
try

public class TestProgram extends HttpServlet {
public void doGet(HttpServletRequest req,
HttpServletResponse res)
throws
ServletException, IOException {
res.setContentType("text/plain;
charset=EUC-KR");
PrintWriter out = res.getWriter();
res.setHeader("Content-Language", "ko");
Locale locale = new Locale("ko", "");
DateFormat full =
DateFormat.getDateTimeInstance(DateFormat.LONG,
ateFormat.LONG,
ocale);
out.println("In Korean:");
try {
FileInputStream fis =
new
FileInputStream(req.getRealPath("/HelloWorld.ISO-2022-
KR.doc"));
InputStreamReader isr = new
InputStreamReader(fis, "ISO-2022-KR");
BufferedReader reader = new
BufferedReader(isr);
String line = null;
while ((line = reader.readLine()) != -1) {
out.println(line);
catch (FileNotFoundException e) {
println(full.format(new Date()));
i had used these code for that ..........
i have stored Korean language in doc file .......but
while displaying in browser i'm getting a lot of
special characters and question marks
displaying..........what should i do???
try

Similar Messages

  • How to read and display a signal from my a miccrontroller (MCB1700) onto labview connected via a CAN port on a PXI machine

    How do you read and display a signal from my a miccrontroller (MCB1700) onto labview connected via a CAN port on a PXI machine?
    I tried using a DAQ Assistant but the CAN port is not included as one of the supported physical channels even though all its drivers are upto date.
    Please help..
    Thanks.
    Solved!
    Go to Solution.

    Attached herewith is a print screen of what is showing on MAX
    The CAN ports are on NI PXI-8461
    Hopefully that clarrifies something.
    Attachments:
    Untitled.png ‏212 KB
    Untitled.png ‏212 KB

  • How to read and display a signal from my PIC Microcontr​oller onto Labview?

    Hi,
    I am doing a project on a Pulse Oximeter and i am trying to read and display the signal from my PIC Microcontroller on Labview? How do i go about doing it? I am using the PIC16F877 and also making use of the USART?
    How do i implement and initialise the USART in PIC16? What are the steps to be taken, please guide me through the process? The link provides information regarding the USART connection, initialisting and stuff? Is it correct to use these codes in my program?Link: http://ww1.microchip.com/downloads/en/AppNotes/007​74a.pdf
    Also, i am using the RS232 serial interface to connect to the PC? The connector i am using is the DB9 Connector. Which template and VI can i use? Am i supposed to use the NI-DAQmx and VISA? Also, for my USART connection, i am using the MAX232 Driver which is applicable for my application as i am working with +5V. So far, i have been reading and trying out on Labview and the steps i have taken are:
    1) Open a New VI and used the Instrument I/O(Read & Display) template?
    2) How do i configure the Instrument I/O Assistant Express VI to read the info from my device connected to COM1?
    3) I was reading the Labview Manual, 'Getting Started with Labview' and i was following the steps under Page 55, Communicating with an Instrument. Am i on the right track?
    4) How do i check and make sure that the port settings of the I/O Assistant and my PIC Micro Match
    Please help me out and guide me through the process. I am student at a polytechnic and i am very new to Labview and the software is used as a development tool for the project. I have a deadline to meet and i hope i can get a response as fast as possible. Your help will be kindly and greatly appreciated. I hope to hear from you guys soon.You can e-mail me all your answers at [email protected]
    Thank You
    Best regards,
    Ashwin
    Ashwin Kumar Mansukhani
    Attachments:
    Getting Started with Labview.pdf ‏901 KB

    Hi Ashwin,
    It is a good idea to first be able to communicate with the microcontroller using some sort of serial communication software such as "HyperTerminal" or "Procomm", etc. Refer to MicroChip's recommendations on this.
    Once that works, then you are ready to use LabView.
    Here is a link which covers many aspects of serial communication. Link - click here
    You probably received a development kit. They usually have a readily available interface. It's been a long time since I played with the PIC, but I seem to remember that you need to program the serial communication driver (as well as at least a bootloader) to get the serial communication going. The driver contains the necessary protocols so that you PC can have a machine conversation with the target (PIC).
    It sounds like a fun & interesting project. Please avoid to have replies to your personal email. By having the answers posted to this thread, you will get much more support and advice.
    Have fun,
    JLV

  • How to read and display a signal from my PIC Microcontroller onto Labview

    Hi,
    I am doing a project on a Pulse Oximeter and i am trying to read and display the signal from my PIC Microcontroller on Labview? How do i go about doing it? I am using the PIC16F877 and also making use of the USART?
    How do i implement and initialise the USART in PIC16? What are the steps to be taken, please guide me through the process? The link provides information regarding the USART connection, initialisting and stuff? Is it correct to use these codes in my program?Link: http://ww1.microchip.com/downloads/en/AppNotes/00774a.pdf
    Also, i am using the RS232 serial interface to connect to the PC? The connector i am using is the DB9 Connector. Which template and VI can i use? Am i supposed to use the NI-DAQmx and VISA? Also, for my USART connection, i am using the MAX232 Driver which is applicable for my application as i am working with +5V. So far, i have been reading and trying out on Labview and the steps i have taken are:
    1) Open a New VI and used the Instrument I/O(Read & Display) template?
    2) How do i configure the Instrument I/O Assistant Express VI to read the info from my device connected to COM1?
    3) I was reading the Labview Manual, 'Getting Started with Labview' and i was following the steps under Page 55, Communicating with an Instrument. Am i on the right track?
    4) How do i check and make sure that the port settings of the I/O Assistant and my PIC Micro Match
    Please help me out and guide me through the process. I am student at a polytechnic and i am very new to Labview and the software is used as a development tool for the project. I have a deadline to meet and i hope i can get a response as fast as possible. Your help will be kindly and greatly appreciated. I hope to hear from you guys soon.You can e-mail me all your answers at [email protected]
    Thank You
    Best regards,
    Ashwin
    Ashwin Kumar Mansukhani
    Attachments:
    Getting Started with Labview.pdf ‏901 KB

    Hi Ashwin,
    I am not familiar with the PIC Microcontrollers, but I am assuming you mean that you have the microcontroller sending out serial data that you want to read on another computer with LabVIEW. Please let me know if this is incorrect.
    What type of data is coming out of the serial port? Is it ASCII, or binary? The reason I ask this is that the serial communication in LabVIEW is done through a protocol called VISA, which uses ASCII data to send and receive. You can later convert this data into whatever form you need, but this is what it is designed to read and write.
    You can check the settings such as baud rate and data bits in a configuration utility called Measurement and Automation Explorer, or MAX. When you open up the MAX interface, you can expand the Devices and Interfaces entry on the left, and then expand the Ports entry to see your serial port. When you highlight this port, select the Port Settings tab at the bottom of the window, and you can see what the current settings are, and change them if you need to. You can also set these parameters in LabVIEW using the VISA Configure Serial Port VI.
    You can also test communication in MAX by right clicking on the correct port and choosing Open VISA Session. Then choose the Basic I/O light blue tab, and then go to the Read tab. When you click execute, it should read in what is coming from the serial port. This will allow you to verify that the correct information is coming in before even trying to acquire the data in the LabVIEW environment.
    In LabVIEW, the best resource to use the Basic Serial Write and Read example program that ships with LabVIEW. By examining the block diagram of this program, you will be able to see the basic programming flow of serial communication in LabVIEW.
    I hope this information was helpful! Please let us know if there's anything else we can help with.
    john
    Applications Engineer

  • Reading and displaying Ms.Word document with web dynpro java

    Hi,
    I'm using NetWever developer studio 7..0.21.
    I'm developing web dynpro java application.I'm in difficulty to read and display word document with its original format in web dynpro view. Is it possible?
    If possible , is there a blog etc.?
    Thanks.

    Hello,
    You have to use the Office Integration Library. Please, follow the documentation below:
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/32853febec3c17e10000000a114084/frameset.htm
    I hope this helps you.
    Regards,
    Blanca

  • Does Aperture read and display XMP data generated by LR?

    Does anyone know if Aperture reads and displays XMP data generated by LR? I am not interested particularly in keywords.

    Thanks for the quick reply, William.
    I would suggest to David Schloss and AUPN that this would be a feature worth supporting. Although, hopefully both new software and improving skills in using them make me less concerned about preserving a static conversion or interpretation of an image, I think that whatever software we use to read/exchange keywords and other IPTC data is a constant.

  • Read and display the content of a MS Word document

    Hi all,
    Can any body help me out in reading and displaying the content of a document(Microsoft word) and text file using java .
    thanks in advance.

    Yeah, there's apache's POI and a couple of other free libraries around.
    I just googled "java word document", and second from the top was:
    Java libraries to read and write Word DOC files
    http://schmidt.devlib.org/java/libraries-word.html

  • Problems while reading and displaying .pdf-Documents from Bfile

    Hi
    I want to read and display .pdf-Documents in Adobe-Reader that are stored as BFile. While displaying the Document Adobe Reader is showing several Errors like " ..less Picture-Data read than expected.. ". Is this a Buffer-Problem? or whatelse ??
    Thanks for help
    null

    PrintStream wr = new PrintStream(socket.getOutputStream());
    wr.close();I suspect this is the problem. You could try socket.shutdownOutput() - or you could just leave the streams alone and let socket.close() shut things down.
    Grant

  • Java XML-Reader (SAX)--How to read and display xml-element-data???

    hello all,
    i would like to display just some xml-data
    Which methods in java should i use to select just one character-data of this (for example: "deu" from the element <Language> or the attribut "version" of the element <catalog>).
    Here is the XML-document i want to parse and display it with System.out.print() :
    <BMECAT version="1.2">
         <HEADER>
              <GENERATOR_INFO>
                   e-proCat 2.1, e-pro solutions GmbH
              </GENERATOR_INFO>
              <CATALOG>
                   <LANGUAGE>deu</LANGUAGE>
                   <CATALOG_ID>Katalog 01</CATALOG_ID>
                   <CATALOG_VERSION>001.000</CATALOG_VERSION>
                   <CATALOG_NAME>ETIM</CATALOG_NAME>
                   <DATETIME type="generation_date">
                        <DATE>2002-05-22</DATE>
                   </DATETIME>
                   <TERRITORY>DE</TERRITORY>
                   <CURRENCY>EUR</CURRENCY>
                   <MIME_ROOT>ETIM-Daten</MIME_ROOT>
              </CATALOG>
    </HEADER>
    </BMECAT>
    Here is the java application i wrote and which doesn t work:
    import org.apache.xerces.parsers.SAXParser;
    import org.xml.sax.Attributes;
    import org.xml.sax.ContentHandler;
    import org.xml.sax.Locator;
    import org.xml.sax.SAXException;
    import org.xml.sax.XMLReader;
         public class XmlLeser implements ContentHandler {
    public XmlLeser(String fileName) {
    try {
    XMLReader myParser = new SAXParser(); // SAXParser (Xerces)
    myParser.setContentHandler(this);           
    myParser.parse(fileName);      } catch (Exception e) {
         System.out.println("Erreur " + e);     }
    }// End of constructor
    public void startDocument() {
         System.out.println(" start to parse " );
    } // startDocument()
    public void endDocument() {
    System.out.println(" End of Parse ");
    } // endDocument()
    public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
         System.out.println(localName) ;
    public void endElement(String namespaceURI, String localName, String qName) throws SAXException {           
    }// Endelement()
    public void characters(char ch[], int start, int length) {
    } // endCharacters(char[],int,int);
    public void processingInstruction(String target, String data) {
    } // processingInstruction(String,String)
    public void ignorableWhitespace(char ch[], int start, int length) {
              characters(ch, start, length);
    } // ignorableWhitespace(char[],int,int);
    public static void main(String args[]) {
    String xmlFileName = "";
    if (args.length == 0) {               
    System.out.println("Usage::java XmlLeser path/xmlFilename");
    System.exit(0);      } else {
    xmlFileName = args[0];
    XmlLeser pux = new XmlLeser(xmlFileName);
    }// end main()
    }//endClass

    You need to pass your filename String as a parameter to your functionality. It depends how you're currently set up though. We can't really see the top of your call so it's difficult to determine what you are calling and we don't really know from where you're calling either.
    If you're running standalone, then on launch of the application, you can feed in a file name as an argument that you can read in in String args[] in the main function and pass down to your XML splitter.
    If you're a method in a class that's part of a bigger pile, you can feed the file name as a String to the method from wherever you call from if it makes sense architecturally.
    You might also want to pass down a File object if that makes sense in your current code (i.e. if you're using your file for other purposes prior to the split, to avoid recreating closing/opening for no reason).
    Depends what you're trying to do. If I put together a piece like this, I would probably create an <yourcurrentrootpackage>.xml.splitter package.
    Also, on a side note, you're problem isn't really reading and writing XML in java, but seems more to be making your functionality generic so that any XML file can be split with your code.
    Regards
    JFM

  • Reading and displaying from a file

    I want my program to be able to read from a file stored on disk and display the contents of the file to a terminal window. I use blueJ if that makes any difference. Can anyone help me with the code to do that please.

    Look at the java.io package.
    In particular the FileReader, BufferedReader, PrintWriter, and OutputStreamWriter classes.
    Read the I/O tutorial (see links on the left).

  • Reading and displaying 100mb file

    hi everyone
    i want to read a uploaded file that may be of 100mb
    the problem is that i want to dispaly that file in a textarea which doesn't support characters more than 65000.
    i had a solution that is to read a file in chunks and displaying it one by one using paging
    can anyone help me with the code
    urgently required
    thanks!!

    Source - http://agards-bible-timeline.com/q10_bible-facts.html .
    The bible has 3,566,480 characters. This means, allowing for punctuation and white space and assuming 1 character per byte, you are trying to display about 25 Bibles.
    The Bible can be read aloud in about 70 hours so it would take your users about 70 days continuous to read your file!
    P.S I am being serious.

  • How to read and display a fits image into JPanel

    Hi,I currently want to read a .fits file and display it in JPanel,have no idea how to achieve it.Any suggestions and source codes are appreciated.Thanks in advance!

    fits stands for flexible image transport system,it defined only for astronomy image data.it is not normal image,I am afraid I can not use the way you said to read fits file.Anyway,thanks a lot.

  • Read and Display an Excel Sheet

    Hello LabVIEW community.  I am going through a bumnch of ActiveX subVIs trying to figure out how to do something very simple.  All I want to do is read an entire Excel Sheet and display it in an array.  Single Page.  Any help would be hot.
    Remember, code does exactly what you tell it.
    Solved!
    Go to Solution.

    camerond wrote:
    DailyDose wrote:
    Is it possible to program this example to simply read all the columns and rows until it comes across like maybe 3 repetitive empty cells instead of having to specify which which row/column to end at?
    Sure. Give it a shot and let us know how you solved it.
    Cameron
    You're right!  It was possible.  Use For loops and check to see when empty cells begin to repeat.  I named it GetXL_CellValues_2D_String_All.vi
    I made mine though very dependent on my excel sheet.  It's easy to make it excel sheet independent.
    Remember, code does exactly what you tell it.
    Attachments:
    read_excel_values.llb ‏267 KB

  • How can I read and display data with OR without recording at the same time?

    Hi all,
      This forum has been of much help to me, but I have a rather specific question I can't seem to find an answer to.  I am new to LabView, educating myself with tutorials, trial and error, and this forum. 
      Attached is what I have so far.  I would like to read data (three voltages) and write it to an excel file.  As written below, it will do nothing until I click the "Record" button, when it then takes data, displays it on the gauges and waveform chart, and writes it to a file.  What I would like it to do is display the data at all times, and record when I click the record button (while still displaying data being read).  I have tried to do this by moving the DAQ Assistant VI, gauges, and waveform graph outside of the loops, but when I do this, it will read until I press record, and then it simply records whatever value it's stuck on.  Sorry for the long post, thanks for any help. 
      --Nathan
    Attachments:
    Record and Write to File 2.vi ‏332 KB

    Sorry, I don't have any DAQ installed, so I won't comment on the DAQ parts.
    First of all, Your VI will do nothing until you (1) first set the record button to ON  and (2) press the start button in the tool bar. It almost seems that you are using the "continuous run" button. (Don't! That's not its purpose. Basically, it automatically restarts the program whenever it finishes). A toplevel VI should never stop during normal operation, so place a big while loop around all code and create a wait state that does nothing until you tell it to acquire.
    You don't need the inner while loop, simply place your code inside the big while loop (and accumulate your array data in an initialized shift register if really needed. Currently you do at the inner loop boundary for some reason). You have a big problem that the array can grow without bounds unless you clear the accumulated data once in a while or place it in a FIFO buffer of limited size. If you let ot grow forever like you do now, the program might run out of resources at one point in the future.
    Since you are appending to your file, maybe yo don't need any shift register, just use the data points of the current iteration. Place your save operations in a case structure and keep appending the new data to your file only if the case is true.
    It is also very inefficient to use highlevel file IO here,because each instance opens and closes the file. I recommend to open the file once outside the loop, then use low level IO to append, and close the file once the big loop is done.
    LabVIEW Champion . Do more with less code and in less time .

  • Reading and displaying iTunes tags

    Hi
    I am working on a Cocoa Applescript App to append text/tags to the comments field of the currently playing track in iTunes. This basically consists of a HUD Window with buttons that append the text via Applescript. I would like to have a section of the HUD Window that displays the text currently written to the comments field, but I'm not sure how to go about this. Would someone be able to point me in the right direction?
    Thanks
    Nick

    Source - http://agards-bible-timeline.com/q10_bible-facts.html .
    The bible has 3,566,480 characters. This means, allowing for punctuation and white space and assuming 1 character per byte, you are trying to display about 25 Bibles.
    The Bible can be read aloud in about 70 hours so it would take your users about 70 days continuous to read your file!
    P.S I am being serious.

Maybe you are looking for