[en] Bootstrap – accordion closes modal

Because Bootstrap events are not namespaced until they release version 3.0 (see https://github.com/twitter/bootstrap/issues/3736), they conflict with each other. It causes for instance closing modals when switching accordion tabs — they both listen to „hidden” event. A simple, global solution is not to use data-toggle=”collapse” but following code (that attaches „live”, 1.9.x jQuery style):

$(document).on('click', 'a.accordion-toggle', function(event) {
    event.preventDefault();
    var parent = $(this).parent().parent(),
        body = parent.find('.accordion-body');
        
    // hide currently shown group
    parent.parent().find('.accordion-body.collapse.in').collapse('toggle').on('hidden', function(event) {
        event.stopPropagation();
    }); 
    
    // show newly clicked group
    body.collapse('toggle').on('hidden', function(event) {
        event.stopPropagation();
    });
});

Roundcube ATT####.dat in Outlook with diacritical characters

When you get reports that some people get e-mails from Roundcube that have ATT####.dat attachments, check if they’re using Microsoft programs, especially Outlook Express. They don’t (of course) implement the most recent RFCs, so if attachment name contains diacritical characters (such as Polish ą, ć, ś, etc.) it gets corrupted. When using Roundcube, the solution is quite simple — search the main config file for „mime_param_folding” and change its value from 0 to 1.

[en] Solution to Postgres JDBC driver ignoring charSet directive with SQL_ASCII database

„New” Postgres JDBC drivers check database engine version and if it’s not below 7.3 they will ignore charSet declaration. It breaks encoding of 8-bit characters if database has SQL_ASCII encoding (which basically means DONT_CARE_ANYTHING_GOES). If your database is set to SQL_ASCII and in reality it stores e.g. Windows-1250 (CP1250) characters, JDBC driver will assume incorrect encoding and diacritical characters will be broken.

Even though I understand the reasons given by Postgres developers for this (SQL_ASCII is NOT supposed to be used with anything other than 7-bit characters and it is obsolete), the solution they’re suggesting (to dump the db, and convert it to UTF-8) is not always possible. For instance, I would have a hard time telling my customer to do it, especially because their old software might break.

So I’ve patched the JDBC driver to accept charSet directive in JDBC URLs and also added a method setCharset to PGSimpleDataSource.

Here you can download it: Postgres JDBC driver – charSet patched