mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-06 00:25:57 +01:00
Set IDNA Transformer in smack-java7 initializer
This commit is contained in:
parent
c5db012fc8
commit
607a5d0c01
1 changed files with 8 additions and 0 deletions
|
@ -20,6 +20,8 @@ import java.util.List;
|
|||
|
||||
import org.jivesoftware.smack.SmackConfiguration;
|
||||
import org.jivesoftware.smack.initializer.SmackInitializer;
|
||||
import org.jivesoftware.smack.util.DNSUtil;
|
||||
import org.jivesoftware.smack.util.StringTransformer;
|
||||
import org.jivesoftware.smack.util.stringencoder.Base64;
|
||||
import org.jivesoftware.smack.util.stringencoder.Base64UrlSafeEncoder;
|
||||
import org.jivesoftware.smack.util.stringencoder.java7.Java7Base64Encoder;
|
||||
|
@ -32,6 +34,12 @@ public class Java7SmackInitializer implements SmackInitializer {
|
|||
SmackConfiguration.setDefaultHostnameVerifier(new Java7HostnameVerifier());
|
||||
Base64.setEncoder(Java7Base64Encoder.getInstance());
|
||||
Base64UrlSafeEncoder.setEncoder(Java7Base64UrlSafeEncoder.getInstance());
|
||||
DNSUtil.setIdnaTransformer(new StringTransformer() {
|
||||
@Override
|
||||
public String transform(String string) {
|
||||
return java.net.IDN.toASCII(string);
|
||||
}
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue