Dealing with MS Word special chars

Hi,
Is there a java.String method (or similar) which will replace MS Word special chars - such as "culry apostrophes" - with HTML compliant versions?
cheers
Hugh
Edited by: inabind on Aug 11, 2008 7:39 AM

Yes. Oddly enough their names start with "replace".
But you don't necessarily need to convert the left curly quote to ߡ or whatever it converts to. You could also use UTF-8 as your HTML's encoding and just leave that character as is.

Similar Messages

  • Any workaround for dealing with MS Word docs without using MS Office?

    Hi, I've been emailed a highly formatted MS word document that I need to fill in and email back. Trouble is that my copy of Pages 08 says 'text frames aren't supported and have been converted to text boxes' - the result being that the form is jumbled up to say the least and unusable, is there a workaround without having to use Microsoft word itself?
    thanks
    Simon

    You could try http://www.openoffice.org , or
    http://www.panergy-software.com/products/lp/we/gn_op.html
    However with very complex formatting you may well find that it's just not possible for other programs to handle it.

  • What is the deal with my word spacing being very WIDE?

    I have TCS2 with Frame9 and RoboHelp8. I linked my Frame doc in RH and the word spacing is so wide. I used the preview and it still is strange looking. The css has word spacing at 0.25em so that seems right. Does anyone have a clue what is going on?
    Thanks

    Adobe only listens if you know the ear to speak into!
    This is known as the Wish Form or the Bug Report.
    Link is in my sig... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7 or 8 within the day - $24.95!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • Problem in dealing with special-character filename

    Hi,
    I am facing a weird problem while dealing with a file which has a special character in its name. That character is the big-hyphen, i.e. '–' (not the normal hyphen we can type from keyboard), you would have seen this character in MS Word.
    My java program is running on HP-UX OS, and its basically trying to copy this file to a Windows target system through socket. But while executing it, I am getting Broken Pipe Exception.
    I am applying UTF-8 encoding while running my program (by specifying the argument "-Dfile.encoding=UTF-8" in the java process), and I am also confirming that the file-encoding is being applied to UTF-8 properly by putting a debug in the beginning of the program. My understanding is UTF-8 supports all the characters exist in this world.
    Any suggestion / pointers would be really appreciated.
    Thanks,
    Rajiv

    Fine..... but is there any way to know which encoding has been applied on it ..
    Let's say if you create any file on unix-based system in any application, which encoding gets applied there by default ?
    This file is basically nothing but an html page created using 'Save As' from the browser.
    The person who has created the file is a non-technical .. and won't know much about this all stuff... encoding etc.

  • How to deal with special character in source file

    Hi experts,
                      i am doing a file to file scenario in which my source file contains many special characters when i am puting this file into moni its going with the special character .My source file is a fixed length file so in content conversion i have specified the file length but due to these special charcters these field lenght is also varing.So please guide me how to deal with these special characters in sender adapter
    regards,
    Saurabh

    you could try using a Java Mapping to change the encoding manually. For that, set the encoding of the OutputFormat of the XML you'll serialize. Try the following code piece for the mapping (inside a try/catch declaration):
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder documentBuilder = factory.newDocumentBuilder();
    Document input = documentBuilder.parse(in);
    OutputFormat format = new OutputFormat(XML, "ISO-8859-1", false);
    XMLSerializer serializer = new XMLSerializer(out, format);
    For more details check this guide:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42

  • Problem with special chars in BLOB datatype using contains keyword

    Facing problem, when part searching with special chars in BLOB datatype. It is considering the non alpha-numeric chars as a separtor in a provided string
    EX:
    SELECT *
    FROM RESUME_TEST P,grst_candidate d
    WHERE d.candidate_id = p.candidate_id
    AND CONTAINS(P.CAND_RESUME,'%VB.NET%',1) > 0
    Strings: , VB.NET , PL/SQL AS/400 , C etc..
    Followed the below approaches
    1) created a table:
    Syntax: create table resume_Test(cand_id number(10),cand_resume blob);
    2) inserted the values into this table upto 60,000
    3) created a context index
    3.1 created preferences
    Syntax:
    BEGIN
    ctx_ddl.create_preference('try_lexer3','BASIC_LEXER');
    ctx_ddl.set_attribute('try_lexer3','printjoins','-_~!@#$%^&*(){}[],=?\;|><.+');
    END;
    3.2 created context index
    Syntax:
    CREATE INDEX CANDRESUME_CTX_IDX ON resume_test (cand_resume)
    INDEXTYPE IS CTXSYS.CONTEXT
    PARAMETERS ('LEXER try_lexer3 memory 500M');
    4) while executing this index, it is taking much time approx 6 hrs(plz explain why it is taking time)
    5) Problems:
    5.1 when searching with string(VB.NET , PL/SQL AS/400 , C etc..) it is considering the special char as a separator
    5.2 used escape char (\) also, but no effect
    5.3 when searching with single char, it is giving error (ORA-29902,ORA-20000,DRG-51030)
    5.4 getting the above error with wild card chars (& ,_, (),{},[])
    So, please explain the clear scenarios, why am getting this error , and how to get the proper results.

    Have you tried adding the / char to the printjoin characters?
    Indexing can take a lot of time, depending on the amount of data and your machine's power. You could try to parallelize the index creation and / or assign more memory
    CREATE INDEX CANDRESUME_CTX_IDX ON resume_test (cand_resume)
    INDEXTYPE IS CTXSYS.CONTEXT
    PARAMETERS ('LEXER try_lexer3 memory 2000M') PARALLEL 8;

  • Replacing space with special char in reporting

    I have created a calculatd Keyfigure where if the consition given in the calculated KF satisfies then it displays 1 otherwise space ,now mu user wants space to be replaced by some special charcter
    Example
    My ckf is like this overallscore >= 90 & Iam applying count on this
    Vendor   CKF
    X              1
    Y
    Z                1
    As vendor y is not satsifying the condition its showing with space now I want to replace space with some special char how is this possible

    Hi Priya,
    You can try this: Instead of space, fill this with a 0. Then in the query properties, set the Show Zero As and give your special char, like may be *. But this will be okay if you do not have other zeros in the report...else you may need to do some VB coding.
    Hope this helps...

  • SLM2048 - Password problems with special chars

    Hi all,
    We´ve got a SLM2048 in use  (most current FW) and I wanted to apply our new password standards  onto that switch. So I changed the password of the user admin and used  special chars, which were =&!= and clicked update and save changes. I  now know, that I should have been using only alphanumerical characters,  but why is there no routine that checks the PW for conformance, before  writing it onto the switch.
    Problem now is, that I am unable to login and  don´t want to do a hard reset, because the configuration would be lost. I  know there should have been a rescue admin user, but there is none.  What can I do now? Any chance that a cisco engineer could get in contact  with me to debug the entered password in the lab and who could then  tell me what was saved to ROM or how I can login again?
    Thanks,
    Philip

    If your switch has a console port, you can try this:
    http://www.opendreams.net/jesse/doc/linksys_srw_switch_password_recovery.txt
    http://www.cisco.com/en/US/products/ps9967/products_qanda_item09186a0080a36735.shtml
    HTH,
    Andrew Lissitz

  • OAPs - Any special deals with line connection / re...

    Hello - I think I may know the answer but are there any special BT deals available for OAPs regarding line connection and rental.
    My inlaws have just returned to the UK after 30 years in Cyprus - moving to their own flat here in the UK - both aged 82
    Solved!
    Go to Solution.

    Hi stevedan,
    If your in-laws are in receipt of a pensions credit they may be eligible for the BT Basic service.
    Cheers
    Neil 
    BTCare Community Mod
    If we have asked you to email us with your details, please make sure you are logged in to the forum, otherwise you will not be able to see our ‘Contact Us’ link within our profiles.
    We are sorry but we are unable to deal with service/account queries via the private message(PM) function so please don't PM your account info, we need to deal with this via our email account :-)
    If someone answers your question correctly please let other members know by clicking on ’Mark as Accepted Solution’.

  • 39525 as char/ dealing with unsigned 2byte

    if i have a string "39525" and i want to make that an unsigned 2byte, i use char right? how do i get it into a char? it needs to be an integer first, i don't want to convert the string value. so i Integer.parseInt("") and i get it in an 'int'. what next? is there a better way?
    how do you normally deal with 2byte unsigned chars?

    it fills up too high though.. i need numbers over
    65472 to overflow, not above Integer.MAX_VALUE.
    the low 16 bits of int do overflow, that is enough.
    if you wish to access the low 16 bits, do this:
    int low16bits = value & 0xFFFF;
    i think i got it though..
    char a =
    Character.toChars(Integer.parseInt("12512512"))[0];
    sloppy but i hope it'll work.
    It won't; did you read the API documentation of the toChars method? It does something completely different. I posted the code you asked for above, but I really think you should be using ints, not chars.
    now i need to figure out how to Pad with up to 4
    zeros in hex with this char. is there anything in
    java like
    sprintf("%04x", $x)
    yes; see java.util.Formatter

  • Dealing with special characters

    Hello Guys,
    I have some time finding for solutions trying to filter out the columns with occurence of special character.
    Can anybody help me build a query to trap/filter colums with occurence of unwanted any_+ special characters?
    A syntax for finding any special characters would do.
    I am using Oracle SQL Developer Version 1.5.5.
    Thanks...
    Edited by: ard565 on Jan 26, 2010 7:06 PM

    Hi,
    Can you provide the structure of the table, and do you want to filter the record if special character occurs on any column of the table or any particular column.
    Moreover in your terms what does special character stands for. Is it all the character that is not alpha numeric or specific set of special character?
    Regards
    Anurag

  • Help with program using hashtable to count words & other chars in txt file

    I need to use only a hashtable to count the occurences words and chars in a text file and display them alphabetically. I am not to use anything but the hashtable. so far, I can get it to count only the words in the file and not the chars, I want to know how to make it count the chars (,.;:?(){}[]!@#$%^&\t\"<>/`~ ) that may be found and if it is possible to get it to display them in a sorted (alphabetical) order w/o using anything else.
    This is what I have: mport java.io.*;
    import java.util.*;
    import javax.swing.JOptionPane;
    class words{
    String word;
    int count;
    public class WordCount{
    static Hashtable h=new Hashtable();
    static words w;
    static void countWords(String s){
    if((w=(words)h.get((java.lang.Object)s))==null){
    w=new words();
    w.word=s;
    w.count=1;
    h.put(s,w);
    }else{
    w.count++;
    h.remove(s);
    h.put(s,w);
    public static void main(String args[]){
    String s;
    StringTokenizer st;
    String t;
    String fn = JOptionPane.showInputDialog("Enter the filename:");
    BufferedReader br = null;
    try{
    br = new BufferedReader(new FileReader(fn));
    s=br.readLine();
    while(s!=null){
    st= new StringTokenizer(s, " ,.;:?(){}[]!@#$%^&\t\"<>/`~  ");
    // Split your words.
    while(st.hasMoreTokens()){
    t=st.nextToken();
    countWords(t);
    s=br.readLine();
    }catch(Exception e){
    e.printStackTrace();
    Enumeration e=h.elements();
    w=(words)e.nextElement();
    while(e.hasMoreElements()){
    System.out.println(w.word + " " + w.count);
    w=(words)e.nextElement();
    System.exit(0);
    }

    Please don't crosspost. It cuts down on the effectiveness of responses, leads to people wasting their time answering what others have already answered, makes for difficult discussion, and is generally just annoying and bad form.

  • Issue: Not getting response when the document is having special chars

    Please help following issue: Not getting response when the document is having special chars(Use any doc with special char(ex: &, $, <, >,.....) TestErrorFour.doc
    Error message:
    System.FormatException: Invalid length for a Base-64 char array. at
    System.Convert.FromBase64String(String s) at
    Summarize.Summarizer.AccumulateBroadcast(String filedata, String givenWords) in
    c:\DocumentSummarizer\App_Code\Summarizer.cs:line 66
    Code:
    File 1:
    import java.io.BufferedReader;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.OutputStream;
    import java.net.HttpURLConnection;
    import java.net.URL;
    import java.net.URLConnection;
    import java.util.Properties;
    import org.apache.poi.poifs.filesystem.POIFSFileSystem;
    import org.apache.poi.hwpf.*;
    import org.apache.poi.hwpf.extractor.*;
    import com.lowagie.text.Document;
    import com.lowagie.text.pdf.PRTokeniser;
    import com.lowagie.text.pdf.PdfReader;
    public class DocumentSummarizerClient {
         static Properties loadProperties() {
              Properties prop = new Properties();
              try {
                   prop.load(DocumentSummarizerClient.class.getClassLoader().getResourceAsStream("vep.properties"));
              } catch (Exception ioe) {
                   ioe.printStackTrace();
              return prop;
         public String getSummary(String fileName,String noOfWordsOrPercentage ){
              String summaryInputData ="";
              String summarizedData="";
              String summarizerURL = loadProperties().getProperty("Summarizer.serviceURL");
              try {
                   String fileExtension=fileName.substring(fileName.lastIndexOf(".")+1, fileName.length());
                   if (fileExtension.equalsIgnoreCase("doc")|| fileExtension.equalsIgnoreCase("txt")|| fileExtension.equalsIgnoreCase("pdf")) {
                                  if (fileExtension.equalsIgnoreCase("txt")) {
                                       BufferedReader bufferedReader = new BufferedReader(
                                                 new FileReader(fileName));
                                       String line = null;
                                       while ((line = bufferedReader.readLine()) != null) {
                                            summaryInputData += line;
                                  if(fileExtension.equalsIgnoreCase("doc")){
                                       POIFSFileSystem fs = null;
                                        fs = new POIFSFileSystem(new FileInputStream(fileName));
                                         HWPFDocument doc = new HWPFDocument(fs);
                                         WordExtractor we = new WordExtractor(doc);
                                         String[] paragraphs = we.getParagraphText();
                                         for( int i=0; i<paragraphs .length; i++ ) {
                                            paragraphs[i] = paragraphs.replaceAll("\\cM?\r?\n","");
                                  summaryInputData+= paragraphs[i];
                                  if(fileExtension.equalsIgnoreCase("pdf")){
                                       Document document = new Document();
                   document.open();
                   PdfReader reader = new PdfReader(fileName);
                   int pageCount =reader.getNumberOfPages();
                        for(int i=1;i<=pageCount;i++){
                                  byte[] bytes = reader.getPageContent(i);
                                  PRTokeniser tokenizer = new PRTokeniser(bytes);
                                  StringBuffer buffer = new StringBuffer();
                                  while (tokenizer.nextToken()) {
                                  if (tokenizer.getTokenType() == PRTokeniser.TK_STRING) {
                                  buffer.append(tokenizer.getStringValue());
                                  summaryInputData += buffer.toString();
                   else{
                        System.out.println("This is Invalid document. Presntly we support only text,word and PDF documents ");
                   // String encoded =new String (summaryInputData.getBytes("ISO-8859-1"),"UTF-8");
                        String encoded=Base64Utils.base64Encode(summaryInputData.getBytes());
                   // encoded =new String (summaryInputData.getBytes("ISO-8859-1"),"UTF-8");
                        String parameters= "base64String="+encoded+"&noOfWordsOrPercentage="+noOfWordsOrPercentage;
                        summarizedData= postRequest(parameters,summarizerURL);
                        String slength= "<string xmlns=\"http://tempuri.org/\">";
                        if(summarizedData.contains("</string>")){
                        summarizedData= summarizedData.substring(summarizedData.indexOf(slength)+slength.length(),summarizedData.indexOf("</string>"));
                        summarizedData = replaceVal(summarizedData);
                        //System.out.println("<?xml version=\"1.0\" encoding=\"utf-8\"?><![CDATA["+summarizedData+"]]>");
                        // System.out.println("Summarized data "+summarizedData);
                        if(summarizedData.contains("Please enter the percentage")){
                             summarizedData="Data given cannot be summarized further";
                   else{
                        System.out.println("Data given cannot be summarized further");
                        summarizedData="";
              } catch (FileNotFoundException e) {
                   return("The File is not found \n\n"+e.toString());
              } catch (IOException e) {
                   return("The File is already in use \n\n"+e.toString());
              } catch (Exception e) {
                   return(e.toString());
              return summarizedData;
         public static String postRequest(String parameters,String webServiceURL) throws Exception{
              Properties systemSettings = System.getProperties();
              systemSettings.put("http.proxyHost", loadProperties().getProperty("proxyHost"));
         systemSettings.put("http.proxyPort", loadProperties().getProperty("proxyPort"));
         System.setProperties(systemSettings);
              String responseXML = "";
              try {
                   URL url = new URL(webServiceURL);
                   URLConnection connection = url.openConnection();
                   HttpURLConnection httpConn = (HttpURLConnection) connection;
                   byte[] requestXML = parameters.getBytes();
                   httpConn.setRequestProperty("Content-Length", String
                             .valueOf(requestXML.length));
                   httpConn.setRequestProperty("Content-Type",
                             "application/x-www-form-urlencoded");
                   httpConn.setRequestMethod("POST");
                   httpConn.setDoOutput(true);
                   httpConn.setDoInput(true);
                   OutputStream out = httpConn.getOutputStream();
                   out.write(requestXML, 0, requestXML.length);
                   out.close();
                   InputStreamReader isr = new InputStreamReader(httpConn
                             .getInputStream());
                   BufferedReader br = new BufferedReader(isr);
                   String temp;
                   String tempResponse = "";
                   while ((temp = br.readLine()) != null)
                        tempResponse = tempResponse + temp;
                   responseXML = tempResponse;
                   br.close();
                   isr.close();
              } catch (java.net.MalformedURLException e) {
                   System.out
                             .println("Error in postRequest(): Secure Service Required");
              } catch (Exception e) {
                   System.out.println("Error in postRequest(): " + e.getMessage());
              return responseXML;
         public String replaceVal(String value) {
                   if (value == null) {
                        value = "";
                   value = value.replace("&lt;", "<");
                   value = value.replace("&gt;", ">");
                   value = value.replace("&amp;", "&");
                   return value;
              public static void main(String[] args) {  
                   DocumentSummarizerClient testdoc=new DocumentSummarizerClient();
                   System.out.println("hello");               
                   testdoc.getSummary("C:\\working_folder\\vep\\UnitTestCases\\VEP1.0\\DocumentSummarizerTestData\\TestErrorFour.doc","100%");     
    Note: Use any doc with special char(ex: &, $, <, >,.....) TestErrorFour.doc
    File 2:
    ---------public class Base64Utils {
    private static byte[] mBase64EncMap, mBase64DecMap;
    * Class initializer. Initializes the Base64 alphabet (specified in RFC-2045).
    static {
    byte[] base64Map = {
    (byte)'A', (byte)'B', (byte)'C', (byte)'D', (byte)'E', (byte)'F',
    (byte)'G', (byte)'H', (byte)'I', (byte)'J', (byte)'K', (byte)'L',
    (byte)'M', (byte)'N', (byte)'O', (byte)'P', (byte)'Q', (byte)'R',
    (byte)'S', (byte)'T', (byte)'U', (byte)'V', (byte)'W', (byte)'X',
    (byte)'Y', (byte)'Z',
    (byte)'a', (byte)'b', (byte)'c', (byte)'d', (byte)'e', (byte)'f',
    (byte)'g', (byte)'h', (byte)'i', (byte)'j', (byte)'k', (byte)'l',
    (byte)'m', (byte)'n', (byte)'o', (byte)'p', (byte)'q', (byte)'r',
    (byte)'s', (byte)'t', (byte)'u', (byte)'v', (byte)'w', (byte)'x',
    (byte)'y', (byte)'z',
    (byte)'0', (byte)'1', (byte)'2', (byte)'3', (byte)'4', (byte)'5',
    (byte)'6', (byte)'7', (byte)'8', (byte)'9', (byte)'+', (byte)'/'};
    mBase64EncMap = base64Map;
    mBase64DecMap = new byte[128];
    for (int i=0; i<mBase64EncMap.length; i++)
    mBase64DecMap[mBase64EncMap[i]] = (byte) i;
    * This class isn't meant to be instantiated.
    private Base64Utils() {
    * Encodes the given byte[] using the Base64-encoding,
    * as specified in RFC-2045 (Section 6.8).
    * @param aData the data to be encoded
    * @return the Base64-encoded <var>aData</var>
    * @exception IllegalArgumentException if NULL or empty array is passed
    public static String base64Encode(byte[] aData) {
    if ((aData == null) || (aData.length == 0))
    throw new IllegalArgumentException("Can not encode NULL or empty byte array.");
    byte encodedBuf[] = new byte[((aData.length+2)/3)*4];
    // 3-byte to 4-byte conversion
    int srcIndex, destIndex;
    for (srcIndex=0, destIndex=0; srcIndex < aData.length-2; srcIndex += 3) {
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex] >>> 2) & 077];
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex+1] >>> 4) & 017 |
    (aData[srcIndex] << 4) & 077];
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex+2] >>> 6) & 003 |
    (aData[srcIndex+1] << 2) & 077];
    encodedBuf[destIndex++] = mBase64EncMap[aData[srcIndex+2] & 077];
    // Convert the last 1 or 2 bytes
    if (srcIndex < aData.length) {
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex] >>> 2) & 077];
    if (srcIndex < aData.length-1) {
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex+1] >>> 4) & 017 |
    (aData[srcIndex] << 4) & 077];
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex+1] << 2) & 077];
    else {
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex] << 4) & 077];
    // Add padding to the end of encoded data
    while (destIndex < encodedBuf.length) {
    encodedBuf[destIndex] = (byte) '=';
    destIndex++;
    String result = new String(encodedBuf);
    return result;
    * Decodes the given Base64-encoded data,
    * as specified in RFC-2045 (Section 6.8).
    * @param aData the Base64-encoded aData.
    * @return the decoded <var>aData</var>.
    * @exception IllegalArgumentException if NULL or empty data is passed
    public static byte[] base64Decode(String aData) {
    if ((aData == null) || (aData.length() == 0))
    throw new IllegalArgumentException("Can not decode NULL or empty string.");
    byte[] data = aData.getBytes();
    // Skip padding from the end of encoded data
    int tail = data.length;
    while (data[tail-1] == '=')
    tail--;
    byte decodedBuf[] = new byte[tail - data.length/4];
    // ASCII-printable to 0-63 conversion
    for (int i = 0; i < data.length; i++)
    data[i] = mBase64DecMap[data[i]];
    // 4-byte to 3-byte conversion
    int srcIndex, destIndex;
    for (srcIndex = 0, destIndex=0; destIndex < decodedBuf.length-2;
    srcIndex += 4, destIndex += 3) {
    decodedBuf[destIndex] = (byte) ( ((data[srcIndex] << 2) & 255) |
    ((data[srcIndex+1] >>> 4) & 003) );
    decodedBuf[destIndex+1] = (byte) ( ((data[srcIndex+1] << 4) & 255) |
    ((data[srcIndex+2] >>> 2) & 017) );
    decodedBuf[destIndex+2] = (byte) ( ((data[srcIndex+2] << 6) & 255) |
    (data[srcIndex+3] & 077) );
    // Handle last 1 or 2 bytes
    if (destIndex < decodedBuf.length)
    decodedBuf[destIndex] = (byte) ( ((data[srcIndex] << 2) & 255) |
    ((data[srcIndex+1] >>> 4) & 003) );
    if (++destIndex < decodedBuf.length)
    decodedBuf[destIndex] = (byte) ( ((data[srcIndex+1] << 4) & 255) |
    ((data[srcIndex+2] >>> 2) & 017) );
    return decodedBuf;
    issue 2: Exception when passing 2MB .txt file
    Steps to reproduce:
    Call getSummary() with 2MB .txt file
    Actual:
    The following exception has occured:
    1. Error in postRequest(): Unexpected end of file from server
    java.lang.NullPointerException
    Please provide your precious feedback/suggestions.
    Thanks in advance…..
    Edited by: EJP on 15/03/2011 16:52: added code tags. Please use them. Code is unreadable otherwise.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Thanks for your response….
    This is enhancement project and some one develops long back.
    Regarding point (b) You should be using the java.net.URLEncoder to encode URL parameters, not a base64 encoder.
    DocumentSummarizerClient.java I am using base64
    Ex:
    // String encoded =new String (summaryInputData.getBytes("ISO-8859-1"),"UTF-8");
                        String encoded=Base64Utils.base64Encode(summaryInputData.getBytes());
                   // encoded =new String (summaryInputData.getBytes("ISO-8859-1"),"UTF-8");
                        String parameters= "base64String="+encoded+"&noOfWordsOrPercentage="+noOfWordsOrPercentage;
                        summarizedData= postRequest(parameters,summarizerURL);
                        String slength= "<string xmlns=\"http://tempuri.org/\">";
                        if(summarizedData.contains("</string>")){
                        summarizedData= summarizedData.substring(summarizedData.indexOf(slength)+slength.length(),summarizedData.indexOf("</string>"));
                        summarizedData = replaceVal(summarizedData);
                        //System.out.println("<?xml version=\"1.0\" encoding=\"utf-8\"?><![CDATA["+summarizedData+"]]>");
                        System.out.println("Summarized data "+summarizedData);
                        if(summarizedData.contains("Please enter the percentage")){
                             summarizedData="Data given cannot be summarized further";
    Above specific please I need to modify to resolve above issue.
    Could you please suggest me what changes I need to do.
    Waiting for positive response.

  • How can I Retrieve special chars from a HTTP Request??

    Hi,
    I want to retrieve special chars from a request
    Chars like accents used in spanish languages or symbols?
    Is there any way to do it
    Thanks in advance
    Alejandro Arredondo

    This is my problem
    For example:
    This is my form:
    <form>
    <input type="text" name="test">
    </form>
    I do write a char on the text area. Something like "?" or "?"
    or some words with accents
    When I retrieve the value with
    String value = request.getParameter("test");
    and print it
    out.println("TEST= " + test);
    It prints another symbol that isn't the one I sent in my form.
    why?
    Thanks

  • SQL Developer Problems with Microsoft Word Apostrophes

    Hi,
    I'm trying to copy and paste a list like the following from Microsoft Word to SQL Developer -
    '123','456','789'
    Shouldnt be a problem.
    But when ever I paste it into an sql file in Developer it comes out with different styled apostrophes which SQL Developer does not seem to like -
    ‘123’,’123’,’123’
    Obviously I can just do a find and replace and change all of the problem apostrophes but is there a way to stop the problem occuring?
    It doesnt matter what font I am using in Word, I always get the slanted style apostrophes. But in Developer, if I just normally type an apostrophe, I get the acceptable version - '

    I hate copying and pasting to/from word it does far to many things I don't want it to do.
    A trick that sometimes works for me is to copy in word, paste in notepad, then copy in notepad and paste into SQL developer.
    I have replicated your issue but I have found that even this dosn't work.
    You could write a VBA macro in word linked to the ctrl + c short cut that does a text copy and a find and replace on the special chars turning them into normal ones but I think this might be overkill.

Maybe you are looking for