Encode strings to UTF-8 for URLencode

Fixes umlaut queries on windows.

Resolves #3

Change-Id: Ic2ec22a595b5e167abbf374ce4c8e8375837f0b9
diff --git a/R/KorAPQuery.R b/R/KorAPQuery.R
index 230eb24..0b07106 100644
--- a/R/KorAPQuery.R
+++ b/R/KorAPQuery.R
@@ -168,8 +168,8 @@
       }
       request <-
         paste0('?q=',
-               URLencode(query, reserved = TRUE),
-               if (vc != '') paste0('&cq=', URLencode(vc, reserved = TRUE)) else '', '&ql=', ql)
+               URLencode(enc2utf8(query), reserved = TRUE),
+               if (vc != '') paste0('&cq=', URLencode(enc2utf8(vc), reserved = TRUE)) else '', '&ql=', ql)
       webUIRequestUrl <- paste0(kco@KorAPUrl, request)
       requestUrl <- paste0(
         kco@apiUrl,