diff --git a/src/App.vue b/src/App.vue
index 55f534147ad9aca20aca0b412587c85617002457..dd5579279250920169d2ca813272349b088a0c08 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -139,25 +139,27 @@ export default {
       let self = this
       return function(q) {
                 return new Promise(resolve => {
-                  return axios.get(self.api_pref + 'suggest?q=' + q).then(
+                  return axios.get(self.api_pref + 'suggest?q=' + encodeURIComponent(q)).then(
                                     function(response) {
                                         let hits = []
                                         response.data.forEach((item, i) => {
-                                          if (! hits[0] || hits[0].word != item.match) {
-                                            hits.splice(0, 0, {q: q, lang_set: new Set(), word: item.match, articles: []})
+                                          let match = encodeURIComponent(item.match)
+
+                                          if (! hits[0] || hits[0].word != match) {
+                                            hits.splice(0, 0, {q: encodeURIComponent(q), lang_set: new Set(), word: match, articles: []})
                                           }
                                           hits[0].lang_set.add(item.dictionary == 'bob' ? 'bm' : 'nn')
                                           hits[0].articles.push(item)
                                         });
                                         hits.forEach(function (hit) {
                                           if (hit.lang_set) {
-                                            hit.label = `${hit.word} (${Array.from(hit.lang_set).sort().join(', ')})`
+                                            hit.label = `${decodeURIComponent(hit.word)} (${Array.from(hit.lang_set).sort().join(', ')})`
                                           }
                                         });
                                         hits.reverse()
                                         hits = hits.slice(0, 8)
                                         if (q) {
-                                          hits.push({q: q, label: q + ' (fritekstsøk)'})
+                                          hits.push({q: encodeURIComponent(q), label: q + ' (fritekstsøk)'})
                                         }
                                         resolve(hits)
                                       })
diff --git a/src/components/DefElement.vue b/src/components/DefElement.vue
index 67bb56f5ca3913aaf3ec3614fa36514670d50a2c..2e7ad3294d7b881fd0267e317fff7e9473c523cc 100644
--- a/src/components/DefElement.vue
+++ b/src/components/DefElement.vue
@@ -40,7 +40,7 @@ export default {
                                                           type: item.type_,
                                                           html: '',
                                                           link_text: item.word_form ||  item.lemmas[0].lemma,
-                                                          ref: '/' + lang + '/' + item.article_id + '/' + (item.word_form ||  item.lemmas[0].lemma) + (item.definition_id ? '#def' + item.definition_id : ''),
+                                                          ref: '/' + lang + '/' + item.article_id + '/' + encodeURIComponent(item.word_form ||  item.lemmas[0].lemma) + (item.definition_id ? '#def' + item.definition_id : ''),
                                                           article_id: item.article_id,
                                                           definition_id: item.definition_id,
                                                           definition_order: item.definition_order,