java.net.URLEncoder.encode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

Since migrating my application to up to date versions I have run into a
new accent related problem. java.net.URLEncoder.encode is nuking French
accents in URL strings. I am using an sqlEncode script for escaping
accents in  JDBC queries to the database. It works just fine but moving
through record sets does not - the query variable that is passed to the
next page is no longer escaped... The offending Dreamweaver MX code is
as follows:

// add the Form variables to the MM_keepForm string
if (request.getParameterNames().hasMoreElements()) {
  java.util.Enumeration items = request.getParameterNames();
  while (items.hasMoreElements()) {
    String nextItem = (String)items.nextElement();
    boolean found = false;
    for (int i=0; !found && i < MM_removeList.length; i++) {
      if (MM_removeList[i].equals(nextItem)) found = true;
    }
    if (!found && MM_keepURL.indexOf('&' + nextItem + '=') == -1) {
      MM_keepForm = MM_keepForm + '&' + nextItem + '=' +
java.net.URLEncoder.encode(request.getParameter(nextItem));
    }
  }
}

If I convert my database to UTF-8 will this problem go away? It is
currently still LATIN1

Cheers

Tony
-- 
Tony Grant
www.tgds.net - vente d'ordinateurs mini-itx, hébergement: www.3continents.com - international film festival |
www.chez-reine.com - gîte en Bretagne | www.haut-planty.com - Muscadet wine | www.loire-estuaire.org - GIP Loire Estuaire



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux