question

MikhailSmal-8890 avatar image
3 Votes"
MikhailSmal-8890 asked AllemaGlobal-8078 commented

Azure AD B2C Custom policy - translations encoding issue

Hi. We have Azure AD B2C configured with custom policies including custom email verification. In our policy we have provided translations for a number of strings. E.g. "success_send_code_msg". Such message is injected into the sign up page via window.CONTENT variable. It seems the encoding is incorrect. This is how the message looks like:
"success_send_code_msg":"En verifikationskod har skickats till din mailadress. Kopiera koden till fältet nedan."
As you can see the letter ä is UTF encoded and appears exactly as ä in the UI.

Am I doing something wrong or is it a bug? Is there a workaround for that?
Thanks.

azure-ad-b2c
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

alfredorevilla-msft avatar image
0 Votes"
alfredorevilla-msft answered alfredorevilla-msft commented

Hello @mikhailsmal-8890. This could be related to the page layout version you're using. Try using the latest (2.1.0). You can find them appended in the ContentDefinition DataUri value. EG:

<DataUri>urn:com:microsoft:aad:b2c:elements:globalexception:2.1.0</DataUri>


Let us know if this answer was helpful to you. If so, please remember to mark it as the answer so that others in the community with similar questions can more easily find a solution.


· 7
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Same problem here, we have Azure AD B2C with custom policies we have this message

 Le code de v&#233;rification a &#233;t&#233; envoy&#233; &#224; votre bo&#238;te de r&#233;ception. Copiez-le dans la zone de texte ci-dessous.


It looks like the strings saved in the Javascript SA_FIELDS variable are incorrectly encoded

 "success_send_code_msg":"Le code de v&#233;rification a &#233;t&#233; envoy&#233; &#224; votre bo&#238;te de r&#233;ception. Copiez-le dans la zone de texte ci-dessous."
1 Vote 1 ·

Hi anonymous user-msft, thanks for your answer.

We have the following DataUri in that ContentDefinition:
<DataUri>urn:com:microsoft:aad:b2c:elements:contract:selfasserted:2.1.0</DataUri>

Isn't it correct?

0 Votes 0 ·

If you're using a self asserted tehcnical profile yes it's correct.

0 Votes 0 ·

As you can see we have the latest version. Apparently, that's not an issue

0 Votes 0 ·
Show more comments
JulesPERRODON-7865 avatar image
1 Vote"
JulesPERRODON-7865 answered AllemaGlobal-8078 commented

Same problem here...
While waiting for a fix, I wrote the following javascript to hide the issue. This might help some fellow Frenchmen.

  $(document).ready(function() {
                     const targetNode = $("#emailVerificationControl");
                     const config = { attributes: true, childList: true, subtree: true };
        
                     const callback = function(mutationsList, observer) {
                         if(targetNode.html().includes("&amp;#233;")) {
                             var replaced = targetNode.html().replace(/&amp;#233;/g, 'é');
                             targetNode.html(replaced);
                         }
                     }
        
                     const observer = new MutationObserver(callback);
                     observer.observe(document.getElementById("emailVerificationControl"), config);
                 });
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

How do you inject that javascript in the page ?

0 Votes 0 ·
alfredorevilla-msft avatar image
1 Vote"
alfredorevilla-msft answered AllemaGlobal-8078 published

Hi guys, I'm back. Apologies for the issues. This is a bug which is being resolved. We estimate 2 weeks before being released. Let me know if I can help with anything else.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,

any news for the bug fix ?

regard.

0 Votes 0 ·

Any news ? I still get this issue and my site is mainly used in french.

0 Votes 0 ·
JulesPERRODON-7865 avatar image
0 Votes"
JulesPERRODON-7865 answered

@alfredorevilla-msft Hi ! Any news about this issue?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Octopus-1 avatar image
0 Votes"
Octopus-1 answered

Same problem here with French and German, using user flows only.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MarcusEngebretsen-8452 avatar image
0 Votes"
MarcusEngebretsen-8452 answered

Works for me with

<DataUri>urn:com:microsoft:aad:b2c:elements:contract:selfasserted:2.1.2</DataUri>

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

WilliamWatterson-4445 avatar image
0 Votes"
WilliamWatterson-4445 answered

Tried with <DataUri>urn:com:microsoft:aad:b2c:elements:contract:unifiedssp:2.1.2</DataUri>

It works for most of the elements on the page - but get an issue with <a> tags eg:

64943-image.png



image.png (2.8 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.