How can I convert ASCII characters to ISO8859?

Hi All,
I have written a little application that renames a TV episode by scraping a TV listing site for the episode name. It is written in SWT and works great apart from on small problem. When getting the html back from the site, it sometimes contains special ASCII characters that are not in the ISO8859 (Windows filesystem) character set.
For example, this is the line that I have to parse:
<td style='padding-left: 6px;' class='b2'><a href='/Prison_Break/episodes/569183/03x01'>Orientaci��n</a></td>When viewing it in a browser, it is:
<td style="padding-left: 6px;" class="b2"><a href="/Prison_Break/episodes/569183/03x01">Orientaci�n</a></td>Notice that the o in the title has an accent on it. While researching this problem I stumbled across 'HTML Entities to ISO 8859-1 Converter' at http://www.inweb.de/chetan/English/Resources/Java/HTML%202%20ISO.html. This open source project takes in an html entity like & and returns '&'.
So that is not quite what I want, as my BufferedReader is converting the html entity into the ASCII representation already. I need a way of detecting a non ISO8859 character within an ASCII string, and hopefully replacing its natural 'equivalent' (would be o in this case).
Does anyone know how I could do it without having to check for every special char and replacing (not really an option unless someone has done it before!!)
If not that then, perhaps another way to attack the problem?
Any help greatly appreciated ;)
Dave

Hi,
NZ_Dave wrote:
For example, this is the line that I have to parse:
<td style='padding-left: 6px;' class='b2'><a href='/Prison_Break/episodes/569183/03x01'>Orientaci��n</a></td>
This is coded in UTF-8. If you convert the bytes to a String using the UTF-8 encoding, then you will have the correct characters "Orientaci�n" in the string.
Check your parser where it converts the bytes (coming from e.g. an InputStream) to characters. Use UTF-8 as the charset when doing that conversion.

Similar Messages

  • How can I use ASCII Characters on the iPad?

    I have an iPad (1) and use iOS 4.3.5. Is there an easier Way of using ASCII Characters than having to use the "copy-Paste" procedure? If not, can we expect to see the feature of entering the ASCII code straight through the standard keyboard soon?

    Norisouro wrote:
    . Is there an easier Way of using ASCII Characters than having to use the "copy-Paste" procedure?
    You need to give some details about what it is you want to do, because ASCII Characters are what are already on the keyboard.  It is non-ASCII that you might need to copy/paste.
    http://en.wikipedia.org/wiki/ASCII
    I think you can be sure that Apple is never going to include a feature in iOS that has you input special characters by typing in numbers like Windows does it.  Mac's have always used a different approach.

  • How can i convert some caracteres of a String in bold characteres?? hELPME

    How can i convert some caracteres of a String in bold caracteres?? hELPME
    I have a JList and a DefaultListModel of Strings. So, i have many key words like "proccess", "if", "fi" that i want these characteres in bold.

    How i can use HTML in java to change a String to bold?
    example
    String str = "channel ";
    str = <b>str</b>;
    like this? syntax error =/

  • How can I convert a string to a seperated characters?

    How can I convert a string to a separated characters without using array?
    such as: input = String "word"
    output =
    w
    o
    r
    d
    Thanks

    A string is stored internally in individual characters.
    The String class has a method 'charAt(int index)' which returns the character at that index so using a for loop..
    String s = "word";
    for(int counter=0; counter < s.length(); counter++)
    System.out.println(s.charAt(counter));
    HTH

  • How can I convert a number to char in javascript

    How can I convert a number i.e ascii number to char in javascript.
    ex: 55 to A

    How can I convert a number i.e ascii number to char in javascript.
    Quite simple: By asking in a forum that deals with javascript and not with java.
    Have no clue...
    Maybe on http://www.irt.org

  • CS3/CS4/CS5 Win/Mac: How can I convert a Windows string to mac?

    Hi
    I have a Windows coded string. I like to convert this string into a Macintosh string. This means several characters are changed, e.g. ä, ö or ü.
    Is there a method in the Indesign SDK?
    How can I convert a windows string into a macintosh string and back?
    Thanks
    Hans

    I don't think this should work that way. If this string is in resource file, use UTF-8 encoding and make PMString do its job. use kResourceUTF8Encoded in StringTable:
    resource StringTable (kSDKDefStringsResourceID + index_enUS)
            k_enUS,                                             // Locale Id
            kResourceUTF8Encoded,                         // Character encoding converter (irp) I made this WinToMac as we have a bias to generate on Win...
                  // ----- Menu strings
                    kWFPCompanyKey,                         kWFPCompanyValue,
                    kWFPAboutMenuKey,                         kWFPPluginName "[US]...",
                    kWFPPluginsMenuKey,                    kWFPPluginName "[US]",
                        kWFPDialogMenuItemKey,               "Show dialog[US]",
                    kSDKDefAboutThisPlugInMenuKey,               kSDKDefAboutThisPlugInMenuValue_enUS,
                    // ----- Command strings
                    // ----- Window strings
                    // ----- Panel/dialog strings
                        kWFPDialogTitleKey,     kWFPPluginName "[US]",
                        kWFP_Tuna_Key,     "Tuna",
                        kWFP_Salmon_Key,     "Salmon",
                        kWFP_Bonito_Key,     "Bonito",
                        kWFP_Yellowtail_Key, "Yellowtail",
                        kWFP_Currency_Key, "$",
              // ----- Misc strings
                    kWFPAboutBoxStringKey,               kWFPPluginName " [US], version " kWFPVersion " by " kWFPAuthor "\n\n" kSDKDefCopyrightStandardValue "\n\n" kSDKDefPartnersStandardValue_enUS,
    Message was edited by: Maciej Przepióra

  • Convert web page to adobe pdf can not convert greek characters

    Convert web page to adobe pdf can not convert greek characters. How to solve it?

    Convert web page to adobe pdf can not convert greek characters. How to solve it?

  • How can I convert an int to a string?

    Hi
    How can I convert an int to a string?
    /ad87geao

    Here is some the code:
    public class GUI
        extends Applet {
      public GUI() { 
        lastValue = 5;
        String temp = Integer.toString(lastValue);
        System.out.println(temp);
        showText(temp);
      private void showText(final String text) {
        SwingUtilities.invokeLater(new Runnable() {
          public void run() {
            tArea2.setText(text + "\n");
    }

  • How can I convert an InputStream to a FileInputStream ???

    How can I convert an InputStream to a FileInputStream ???

    Thanks for you reply, however, I am still stuck.
    I am trying to convert my application (which runs smoothly) to a signed applet. The following is the original (application) code:
    private void loadConfig() {
    String fileName = "resources/groupconfig";
    File name = new File(fileName);
    if(name.isFile()) {
    try {
         ObjectInputStream in = new ObjectInputStream(new FileInputStream(fileName));
         pAndGConfig = (PAGroupsConfig)in.readObject();
         in.close();
         return;
    } catch(ClassNotFoundException e) {
         System.err.println("++ERROR: "+e);
    } catch(IOException e) {
         System.err.println("++ERROR: "+e);
    System.out.println("Can't find file: " + fileName);
    Because all code and resources now reside in a Jar file (for the signed applet), I must use the following line to access the resources:
    InputStream is = this.getClass().getResourceAsStream(fileName);
    I then need to convert the 'InputStream' to 'ObjectInputStream' or 'FileInputStream' so that I can work with it.
    I would be very grateful if you could help shed some light on the matter - Cobram

  • How can I convert an OVM vm (.img) to VDI (virtualbox)?

    Hi,
    how can I convert an OVM vm (.img) to VDI (virtualbox)?
    Is .img format a raw image? If yes can I use "VBoxManage convertdd" to convert from .img to vdi?
    tnx & regards,
    S.

    Hi,
    "VBoxManage convertdd" solved.
    Regards,
    S.

  • How can I convert an AUDIO MPEG-4 to an MPEG3 format? I need it for a Powerpoint Presentation

    How can I convert an AUDIO  MPEG-4 to another type of file, such as MPEG3  or mp3

    Use Handbrake.
    You can download it for free from this site:
    http://www.macupdate.com/info.php/id/12987/handbrake
    Good luck

  • I want to remove the monitor from my 17" Macbook Pro 2008 to use as an external for my Macbook Pro 15" 2012. How can I convert lvds to Thunderbolt and power the monitor?

    I want to remove the monitor from my 17" Macbook Pro 2008 to use as an external for my Macbook Pro 15" 2012. How can I convert lvds to Thunderbolt and power the monitor?

    It's almost impossible.  The new iMacs have a Target Display Mode, but it's built to do that.  Without ripping your screen out, finding an acceptable power supply, frame, and whatever electronics to convert a Thunderbolt signal to the screen, the cost will be much larger than buying a cheaper HiDef monitor that runs with an HDMI to Thunderbolt cable to your MacBook 15.  In fact, you can sell your 17" MBP for a lot of money, unless it's broken or something, buying you a really sweet monitor.
    By the way, I found your answer by searching this forum.  I would suggest using the search function here in the futuere.

  • How can I convert an array off byte into an Object ?

    Hi folks...
    I�m developing an application that comunicates a PDA and a computer via Wi-Fi. I�m using a DataStream ( Input and Output ) to receive / send information from / to the computer. Most off the data received from him is in the byte[] type...
    How can I convert an array off byte ( byte[] ) into an Object using MIDP 2.0 / CLDC 1.1 ?
    I found on the web 2 functions that made this... but it uses a ObjectOutputStream and ObjectInputStream classes that is not provided by the J2ME plataform...
    How can I do this ?
    Waiting answers
    Rodrigo Kerkhoff

    There are no ObjectOutputStream and ObjectInputStream classes in CLDC. You must know what you are writing to and reading from the DataStream. You should write the primitives like int, String to the DataOutputstream at one end and read those in exactly the same sequence at the outher end using readInt(), readUTF() methods.

  • How can I convert a class file to Exe file

    hai
    How can I convert a class file to Exe file

    Please search the forums before asking questions - this has been answered hundreds (really!) of times.

  • How can I convert multiple files at one time and not one at a time

    How can I convert multiple files at one time and not one at a time

    Hi Plissey1950,
    Sorry for the lengthy delay to a response.  Are you trying to convert multiple files to individual PDF files at the same time? (not combine them).  If so, you'll need to use Adobe Acrobat for this function. The CreatePDF service does not have the ability to convert multiple files to multiple individual PDF files.
    Thanks,
    David

Maybe you are looking for

  • Cannot reconnect / specify volume in PSE 8

    I just upgraded from an older version of PSE to PSE 8 for windows.  I am running PSE in Parallels on a Mac.  The older version of PSE worked fine in this configuration.  However, when I upgraded to PSE 8, it seems to be looking for the picture volume

  • RCIRAS0546 Error - Unable to Export a Crystal Report from BOE XI (SP3) 3.1

    Hello, We have just upgraded to Crystal Reports 2008 (from Crystal Reports 10) and BOE XI 3.1 sp3 (from Crystal Enterprise 10).  The reports created in CR 10 open and generate just fine from within CR 2008, and they are saved to BOE XI.  When I view

  • A few Questions For A New User

    Hi, I did a quick search, but did not get direct answers, so I am posting this thread as a group of new user questions (to save forum space). Sorry that they might cover more than one "Forum Category", but they are at least all iPhone 4 questions. It

  • HP Officejet Pro 8500 A909g Crashes My Internet

    I have an HP Officejet Pro 8500 A909g printer connected through a Netgear WNDR3400v2 router which is then shared through 3 computers all running Windows 7 Home Premium, in fact they are all identical. Now for the problem it seems that every time I tu

  • The queries takes too much time

    Hi, I want to compare time of queries between Spatial and PostGIS, but Spatial take too much time. I created spatial indexes in both databases so I have no idea where can be the problem :-(. I'm actually student and I try this for my essay, but I sta