4thline/cling — pull request #46 by lcremmer (2012-12-12 12:59:32+00:00)
Title: Cling fails on android/java platforms whose Locale is set to Turk

Hi,

I have run into an odd behaviour when using Cling on platforms whose Locale has been set to Turk:

The Turck language has an 'odd' behaviour where the letter 'i' doesn't get converted to 'I' when uppercased, and 'I' doesn't get converted to 'i' when lowercased. You can refer to the java documentation here about this subject:

http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html#toLowerCase(java.util.Locale)

This is also discussed in the ICU documentation here (ICU is backing the android implementation of java Locale):

http://userguide.icu-project.org/transforms/casemappings

As Cling uses toUpperCase() and toLowerCase() here and then when generating xml or parsing the HTTP header, this causes SOAPAction to be converted to SOAPACT??ON for example, or IN to ??n thus preventing a valid request to be processed, or a valid response to be outputed.

I have modified Cling to make sure that everywhere toUpperCase() and toLowerCase() are used, Locale.ENGLISH is used to perform the conversion (considering the UPNP/DLNA and SOAP spec are in english) to make this peculiar issue go away.

Cheers,
Laurent.