1

I have a .wsp webpart which pastes a string of text into the site collection sharing dialog window upon loading. Unfortunately, all German umlauts are displayed as �.

Umlauts which are ISO-8859-1 are falsely interpreted as UTF-8.

Is there anything I can do in the javascript code of the webpart to change that?`

Thanks a lot.

2
  • Have a look at the .cs/.resx (whatever) file where you define those strings. Try changing the file encoding to UTF-8, save, redeploy.
    – Jussi Palo
    Commented Jun 6, 2018 at 6:50
  • The webpart is a third party webpart and when I open it in SP Designer it only contains a .js file. I'm not familiar with .cs .resx files as I'm not a programmer. Can I easily add this to the .wsp package? Commented Jun 6, 2018 at 7:10

1 Answer 1

1

That depends on the javascript code, what it is doing and whether the settings of the page are overruled by http-header.

You could firstly examine whether your webpart uses css-classes. If there is a reference to a css-file in the js-file you could try to change charset property there. Closer to a solution using the same encoding everywhere is of course to save the given files with the expected encoding as described in this post

An overview about the different steps and their effects is given in this post. And if really nothing else helps than having a workaround setting the output by js than you could manipulate the output by a regex replacing those letters with hex code like in this post

1
  • Thanks, re-saving the .js file in UTF-8 worked wonders. I found out that by editing the file directly in SP Designer it would change the encoding somehow although it's still being shown as UTF-8. If I open the file from SP Designer (open with) in VS Code, I can edit it and just re-save it (maintaining UTF-8) and it works. Commented Jun 6, 2018 at 11:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.