Menu

#1190 UTF-8 characters shown wrong

Parse_Failure
open
nobody
None
5
2008-04-05
2008-04-05
Lupin III.
No

Special characters (among them german umlauts) are now (must have happened in the last two weeks) shown in the wrong encoding. So e. g. "groß" (large, big) is shown as "groß". Since I've been using jbidwatcher 1.02 for a long time now, it seems that ebay changed something (it also broke the "sort by price" functionality)

BTW. the problem that special characters get escaped twice still exists (see a previous bug report).

Discussion

  • Nobody/Anonymous

    Logged In: NO

    The strange things are:

    • charset=ISO-8859-1 (that should be okay)
    • Special characters and mutual vowels show up uncoded
    within the source text, i.e. ß = ß, ä = ä etc.

    I don't know whether the encoding ic changed afterwards
    by the tons of scripting and style sheets eBay nowadays
    uses in every single page, however both characterestics
    were present lang before as well.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    The broken sort by price holds true for currencies not
    US$ - e.g. €, CHF, £, ¥, Canadian + Australian $, etc.

    Thus it seemes the source for the JBW internal currency
    conversion is unavailable resp. has changes and thus
    produces quasi-random results when trying to sort these
    currencies.

     
  • db1ras

    db1ras - 2008-04-06

    Logged In: YES
    user_id=676281
    Originator: NO

    Hi,

    eBay changed the encoding of ebay.com (the page where JBidWatcher gets all his data) to UTF-8, therefore the title and location of German auctions with German umlauts are displayed with the wrong encoding. An example for both issues (title and location) is auction 300208951982.

    The issues happens on Linux and Windows, I don't know if Mac is also affected but I assume that the issues are platform independent.

    Both issues can be fixed with the following patch:

    --- ../jbidwatcher-1.0.2/ebayServer.java 2007-08-11 12:24:46.000000000 +0200
    +++ ebayServer.java 2008-04-06 17:36:14.000000000 +0200
    @@ -2112,10 +2112,8 @@
    }

    private String decodeLatin(String latinString) {
    - // Why? Because it seems to Just Work on Windows. Argh.
    - if(!Platform.isMac()) return latinString;
    try {
    - return new String(latinString.getBytes(), "ISO-8859-1");
    + return new String(latinString.getBytes(), "UTF-8");
    } catch (UnsupportedEncodingException ignore) {
    return latinString;
    }
    @@ -2160,7 +2158,11 @@

    String location = doc.getNextContentAfterRegex(Externalized.getString("ebayServer.itemLocationRegex"));
    if(location != null) {
    + try {
    + _itemLocation = new String(location.getBytes(), "UTF-8");
    + } catch (UnsupportedEncodingException ignore) {
    _itemLocation = location;
    + }
    }

    String pbp = getResult(doc, Externalized.getString("ebayServer.paypalMatcherRegex"), 0);

    Morgan, please include it to the next release,

    Regards,

    Andreas

    P.S.: Is it possible to upload files like patches to existing bug reports since I can't find an upload button?

     

Log in to post a comment.