Skip to content

Commit

Permalink
Fix course and score loading by using UTF-8 (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
rileychh authored Jul 31, 2023
1 parent d279fd3 commit 61c9251
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
9 changes: 0 additions & 9 deletions lib/src/connector/course_connector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ class CourseConnector {
};
parameter = ConnectorParameter(_postCourseCNUrl);
parameter.data = data;
parameter.charsetName = 'big5';
String result = await Connector.getDataByPost(parameter);
tagNode = parse(result);
courseNodes = tagNode.getElementsByTagName("table");
Expand Down Expand Up @@ -497,7 +496,6 @@ class CourseConnector {
Map graduationMap = {};
try {
parameter = ConnectorParameter("https://aps.ntut.edu.tw/course/tw/Cprog.jsp");
parameter.charsetName = "big5";
parameter.data = {"format": "-3", "year": year, "matric": "7"};
result = await Connector.getDataByGet(parameter);
tagNode = parse(result);
Expand All @@ -514,7 +512,6 @@ class CourseConnector {
}
href = "https://aps.ntut.edu.tw/course/tw/$href";
parameter = ConnectorParameter(href);
parameter.charsetName = "big5";
result = await Connector.getDataByGet(parameter);

exp = RegExp(r"最低畢業學分:?(\d+)學分");
Expand Down Expand Up @@ -556,7 +553,6 @@ class CourseConnector {
try {
parameter = ConnectorParameter("https://aps.ntut.edu.tw/course/tw/Cprog.jsp");
parameter.data = {"format": "-1"};
parameter.charsetName = "big5";
result = await Connector.getDataByPost(parameter);
tagNode = parse(result);
nodes = tagNode.getElementsByTagName("a");
Expand Down Expand Up @@ -586,7 +582,6 @@ class CourseConnector {
try {
parameter = ConnectorParameter(_creditUrl);
parameter.data = {"format": "-2", "year": year};
parameter.charsetName = "big5";
result = await Connector.getDataByPost(parameter);
tagNode = parse(result);
nodes = tagNode.getElementsByTagName("a");
Expand Down Expand Up @@ -617,8 +612,6 @@ class CourseConnector {
try {
parameter = ConnectorParameter(_creditUrl);
parameter.data = code;
//Log.d( code.toString() );
parameter.charsetName = "big5";
result = await Connector.getDataByPost(parameter);
tagNode = parse(result);
node = tagNode.getElementsByTagName("table").first;
Expand Down Expand Up @@ -651,8 +644,6 @@ class CourseConnector {
Log.d("select is $select");
parameter = ConnectorParameter(_creditUrl);
parameter.data = code;
//Log.d( code.toString() );
parameter.charsetName = "big5";
result = await Connector.getDataByPost(parameter);
tagNode = parse(result);
node = tagNode.getElementsByTagName("table").first;
Expand Down
1 change: 0 additions & 1 deletion lib/src/connector/ischool_plus_connector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ class ISchoolPlusConnector {
try {
parameter = ConnectorParameter("${_iSchoolPlusUrl}learn/path/SCORM_fetchResource.php");
parameter.data = postParameter;
parameter.charsetName = 'big5';
parameter.referer = "https://istudy.ntut.edu.tw/learn/path/pathtree.php?cid=${postParameter['course_id']}";
Response response;
response = await Connector.getDataByPostResponse(parameter);
Expand Down

0 comments on commit 61c9251

Please sign in to comment.