Reported by aTalk user: Incompatible xml:lang value · Issue #206 · cmeng-git/atalk-android · GitHub
It was found that when an android user changes the device language ‘regional preference’, the customised preference setting is tagged along the Local.getDefault() value. Smack uses this value as xml:lang attribute as it, and causes problem in sending stanza.
However if user chooses other UI language for aTalk e.g. English instead of the Android System Default, then thing works OK.
Below is the lang attribute value being sent when both the temperature and day settings in regional preference are changed:
2023-11-06 08:25:26.090 16440-16547/org.atalk.hmos D/SMACK: SENT (0):
<stream:stream xmlns='jabber:client' to='atalk.sytes.net' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en-US-#u-fw-sun-mu-celsius'>
2023-11-06 08:25:26.097 16440-16548/org.atalk.hmos D/SMACK: RECV (0): ?xml version='1.0'?>
<stream:stream id='6299765005438818111' version='1.0' xml:lang='en' xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client'>
<stream:error>
<invalid-xml xmlns='urn:ietf:params:xml:ns:xmpp-streams'/>
<text xml:lang='en' xmlns='urn:ietf:params:xml:ns:xmpp-streams'>
Bad value of attribute 'xml:lang' in tag <stream:stream/> qualified by namespace 'jabber:client'
</text>
</stream:error>
2023-11-06 08:25:26.105 16440-16539/org.atalk.hmos E/(ProtocolProviderServiceJabberImpl.java:1208)#connectAndLogin: Encounter problem during XMPPConnection: invalid-xml You can read more about the meaning of this stream error at http://xmpp.org/rfcs/rfc6120.html#streams-error-conditions
<stream:error><invalid-xml xmlns='urn:ietf:params:xml:ns:xmpp-streams'/><text xml:lang='en'>Bad value of attribute 'xml:lang' in tag <stream:stream/> qualified by namespace 'jabber:client'</text></stream:error>
2023-11-06 08:25:26.107 16440-16539/org.atalk.hmos E/(ProtocolProviderServiceJabberImpl.java:728)#register: Error registering: XMPPError: policy-violation - modify [invalid-xml You can read more about the meaning of this stream error at http://xmpp.org/rfcs/rfc6120.html#streams-error-conditions
<stream:error><invalid-xml xmlns='urn:ietf:params:xml:ns:xmpp-streams'/><text xml:lang='en'>Bad value of attribute 'xml:lang' in tag <stream:stream/> qualified by namespace 'jabber:client'</text></stream:error>]
2023-11-06 08:25:26.108 16440-16551/org.atalk.hmos W/aTalk: [116] org.jivesoftware.smack.AbstractXMPPConnection.callConnectionClosedOnErrorListener() Connection XMPPTCPConnection[not-authenticated] (0) closed with error
org.jivesoftware.smack.XMPPException$StreamErrorException: invalid-xml You can read more about the meaning of this stream error at http://xmpp.org/rfcs/rfc6120.html#streams-error-conditions
<stream:error><invalid-xml xmlns='urn:ietf:params:xml:ns:xmpp-streams'/><text xml:lang='en'>Bad value of attribute 'xml:lang' in tag <stream:stream/> qualified by namespace 'jabber:client'</text></stream:error>
at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:984)
at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$700(XMPPTCPConnection.java:916)
at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:939)
at java.lang.Thread.run(Thread.java:1012)