Skip to content

Commit 4e3ee37

Browse files
authored
Update Session.java
Support for german "Umlaute" in schoolName
1 parent 17d385c commit 4e3ee37

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/org/bytedream/untis4j/Session.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import java.util.HashMap;
2323
import java.util.Map;
2424
import java.util.Objects;
25+
import java.net.URLEncoder;
26+
import java.nio.charset.StandardCharsets;
2527

2628
/**
2729
* Class to control the untis4j API
@@ -126,7 +128,9 @@ public static Session login(String username, String password, String server, Str
126128
if (!server.startsWith("http://") && !server.startsWith("https://")) {
127129
server = "https://" + server;
128130
}
129-
Infos infos = RequestManager.generateUserInfosAndLogin(username, password, server, schoolName, userAgent);
131+
String encodedSchoolName = URLEncoder.encode(schoolName, StandardCharsets.UTF_8);
132+
133+
Infos infos = RequestManager.generateUserInfosAndLogin(username, password, server, encodedSchoolName, userAgent);
130134

131135
RequestManager requestManager = new RequestManager(infos, useCache);
132136

0 commit comments

Comments
 (0)