Exception in Turkish locale: DOMException: artıst

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Exception in Turkish locale: DOMException: artıst

Draško
Hello everyone,

we have discovered a problem when running our cling-based app in Turkish language. It looks like the string "artıst" has an invalid char. I am looking into it but any hint would be greatly appreciated.

Cheers,
Draško

08-19 10:51:22.473: W/XXX/MyContentDirectoryService.java:126(4905): org.w3c.dom.DOMException: artıst
08-19 10:51:22.473: W/XXX/MyContentDirectoryService.java:126(4905): at org.apache.harmony.xml.dom.NodeImpl.setNameNS(NodeImpl.java:241)
08-19 10:51:22.473: W/XXX/MyContentDirectoryService.java:126(4905): at org.apache.harmony.xml.dom.ElementImpl.<init>(ElementImpl.java:51)
08-19 10:51:22.473: W/XXX/MyContentDirectoryService.java:126(4905): at org.apache.harmony.xml.dom.DocumentImpl.createElementNS(DocumentImpl.java:348)
08-19 10:51:22.473: W/XXX/MyContentDirectoryService.java:126(4905): at org.apache.harmony.xml.dom.DocumentImpl.createElementNS(DocumentImpl.java:48)
08-19 10:51:22.473: W/XXX/MyContentDirectoryService.java:126(4905): at org.fourthline.cling.support.contentdirectory.DIDLParser.appendProperties(DIDLParser.java:588)
08-19 10:51:22.473: W/XXX/MyContentDirectoryService.java:126(4905): at org.fourthline.cling.support.contentdirectory.DIDLParser.generateItem(DIDLParser.java:489)
08-19 10:51:22.473: W/XXX/MyContentDirectoryService.java:126(4905): at org.fourthline.cling.support.contentdirectory.DIDLParser.generateRoot(DIDLParser.java:344)
08-19 10:51:22.473: W/XXX/MyContentDirectoryService.java:126(4905): at org.fourthline.cling.support.contentdirectory.DIDLParser.buildDOM(DIDLParser.java:323)
08-19 10:51:22.473: W/XXX/MyContentDirectoryService.java:126(4905): at org.fourthline.cling.support.contentdirectory.DIDLParser.generate(DIDLParser.java:287)
08-19 10:51:22.473: W/XXX/MyContentDirectoryService.java:126(4905): at org.fourthline.cling.support.contentdirectory.DIDLParser.generate(DIDLParser.java:269)
08-19 10:51:22.473: W/XXX/MyContentDirectoryService.java:126(4905): at de.audi.upnp.MyContentDirectoryService.browse(MyContentDirectoryService.java:115)
Reply | Threaded
Open this post in threaded view
|

Re: Exception in Turkish locale: DOMException: artıst

Draško
The problem seems to be when constructing the "artist" property:

        protected Property(V value, String descriptorName) {
            this.value = value;
            this.descriptorName = descriptorName == null ? getClass().getSimpleName().toLowerCase() : descriptorName;
        }

The parameter descriptorName is null and the member variable descriptorName is calculated via getClass().getSimpleName().toLowerCase()

The following is shown for the Turkish locale:

getClass() = class org.fourthline.cling.support.model.DIDLObject$Property$UPNP$ARTIST
getClass().getSimpleName() = ARTIST
getClass().getSimpleName().toLowerCase() = artıst

Why o why the method toLowerCase make this nonsense?
Reply | Threaded
Open this post in threaded view
|

Re: Exception in Turkish locale: DOMException: artıst

bergstr
in what sense is toLowerCase makeing nonsense? Looks perfectly ok to me..
Reply | Threaded
Open this post in threaded view
|

Re: Exception in Turkish locale: DOMException: artıst

Draško
It is far from perfect ... check the 4th char in "artıst" ... it is causing the DOMException.
Reply | Threaded
Open this post in threaded view
|

Re: Exception in Turkish locale: DOMException: artıst

Robin
http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#toLowerCase%28%29
http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#toLowerCase%28java.util.Locale%29

You could change the Cling Source from toLowerCase() to toLowerCase(Locale.ENGLISH) to get it work with your system locale.
Reply | Threaded
Open this post in threaded view
|

Re: Exception in Turkish locale: DOMException: artıst

Draško
Thanks for the hint. I guess this is of general importance.
Reply | Threaded
Open this post in threaded view
|

Re: Exception in Turkish locale: DOMException: artıst

Christian Bauer
Administrator