Developer forum

Forum » Templates » Facebook encoding nordic chars

Facebook encoding nordic chars

Hans Ravnsfjall
Hans Ravnsfjall
Reply

Maybe not a Dynamicweb specifik case, but I bet many of you have experienced the same problems

Facebook open graph won´t accept nordic chars, and I have tried everything to format/encode the url to make facebook happy - with no luck

I have tried all of these https://docs.microsoft.com/en-us/dotnet/api/system.web.httputility.urlencode?view=netcore-3.1

Anyone got a suggestion on how I can encode the image paths to make facebook happy?

 

/Hans


Replies

 
Hans Ravnsfjall
Hans Ravnsfjall
Reply
 
Nicolai Pedersen
Reply
This post has been marked as an answer

Nordic characters in the URL? Or in the OG metatags...?

If it is the URLs, you have to follow these rules: https://www.facebook.com/business/help/474659792899595?_rdr

You can use "Normalize latin characters", see https://doc.dynamicweb.com/documentation-9/platform/platform-tools/customized-urls#3514

BR Nicolai

Votes for this answer: 1
 
Hans Ravnsfjall
Hans Ravnsfjall
Reply

Ok, but Actually - i am having problems with the og tags. None of the Encoding I try seem to get the result Facebook requires.

I could use Replace, but that seems somewhat cumbersome.

/Hans

 
Nicolai Pedersen
Reply

Well, that should be supported...

What error do you get when using https://developers.facebook.com/tools/debug/ to validate your tags?

BR Nicolai

 
Hans Ravnsfjall
Hans Ravnsfjall
Reply

Sorry for the delay, but now it apparantly works by using the UrlPathEncodeString method

https://docs.microsoft.com/en-us/dotnet/api/system.web.httputility.urlpathencode?view=netcore-3.1

 

Just tried with a path that has nordic chars, and whitespace in the path and apparantly - it works

 

sorry for the confusion

 

/Hans

 

You must be logged in to post in the forum