Skip to main content
Answered

Having issues with UTF-8 names (Hebrew) in with json_encode($current_user->name)


Forum|alt.badge.img+1

The name is showing up in the Messenger in Gibberish.

I'm passing a UTF-8 string:

 

$hebrew_name = urldecode($hebrew_name);

 

Then in the messanger code, I use it like this:

 

window.intercomSettings = {

app_id: "kubohuj0",

name: <?php echo json_encode($hebrew_name) ?>, // Full name

email: <?php echo json_encode($username) ?>, // Email address

created_at: "<?php echo strtotime($current_user->created_at) ?>" // Signup date as a Unix timestamp

 };

 

I tried changing it to

json_encode($name, JSON_UNESCAPED_UNICODE) ;

 

but to no avail.

 

Any ideas?

Best answer by Roy

@user1140​ , Actually once you update, Intercom instantly sees the change.

 

Just to troubleshoot this:

1. Go to https://jsfiddle.net/

2. Paste Intercom code for the logged-in user with Hebrewish name

3. Click Run code and see the result.

 

However, I am convinced that the problem is with the code and not with Intercom.

View original
Did this topic help you find an answer to your question?

4 replies

Forum|alt.badge.img+5
  • Expert User
  • 1152 replies
  • June 6, 2021

Hello @user1140​ 👋,

 

I tried to transfer Hebrewish text to Intercom messenger via Javascript API and it's working fine:

Screenshot (2)It's seams problems coming from your server configuration.

 


Forum|alt.badge.img+1
  • Author
  • Active User
  • 14 replies
  • June 6, 2021

Not sure why it's not working for me... It's kind of hard to debug because it seems like the messenger will cache the name it detects the first time, and changing the code won't help.

 

Any idea how to clear it?


Forum|alt.badge.img+5
  • Expert User
  • 1152 replies
  • Answer
  • June 6, 2021

@user1140​ , Actually once you update, Intercom instantly sees the change.

 

Just to troubleshoot this:

1. Go to https://jsfiddle.net/

2. Paste Intercom code for the logged-in user with Hebrewish name

3. Click Run code and see the result.

 

However, I am convinced that the problem is with the code and not with Intercom.


  • 0 replies
  • June 8, 2021

Hi @user1140​ 🙂

 

Our Support Engineers have confirmed that @roy s11​ 's suggestion is correct and it seems to be a configuration issue on your end.

 

Happy to look into this further if those steps don't work for you! 🔍


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings