UTF8 Encoding Issue in LUIS Query
In LuisService.cs, because of HttpUtility.ParseQueryString, LUIS Query (q) will be converted to UTF-8. As a result, what we got from LUIS (intent, score) are wrong.
e.g. "こんにちは!大家好" will be converted to "%u3053%u3093%u306b%u3061%u306f%uff01%u5927%u5bb6%u597d"
var queryString = HttpUtility.ParseQueryString(string.Empty); queryString["id"] = this.model.ModelID; queryString["subscription-key"] = this.model.SubscriptionKey; queryString["q"] = text;
Does https://github.com/Microsoft/BotBuilder/pull/76 solve your issue?
#76 doesn't solve my issue. Now I use another work around to avoid UTF-8 issue.
HttpUtility.ParseQueryString(String) will parse a query string into a NameValueCollection using UTF8 encoding. Even though HttpUtility.ParseQueryString(String, Encoding) can be used with another encoding. I still think HttpUtility.UrlEncode should replace ParseQueryString in LuisService.cs because LUIS doesn't know URL parameter is encoded by ParseQueryString.
This seems to be the issue you're seeing, I presume:
http://stackoverflow.com/questions/829080/how-to-build-a-query-string-for-a-url-in-c#comment16989179_1877016
So will you change HttpUtility.ParseQueryString to HttpUtility.UrlEncode?
Commit 8381544 should fix this issue.