Can't post unicode emoji

Started by Kolya, April 28, 2017, 06:53:45 PM

Previous topic - Next topic

Gluz

The fix for 2.0.10+ pretty much is the same as for 2.1 beta 3, but it would work only if the forum is in UTF8. I see that in the github and tested in my test forum, I already passed that into my live forum as well.

https://github.com/SimpleMachines/SMF2.1/commit/5b73e8dcc330dfb4d87fec54b7a5518a46272fbf

Basically in /Themes/all_themes_that_have_it/Post.template.php search for all instances of:
.php_to8bit().php_urlencode()

And delete that part, with it, the previews should work.

feline

Better choice ..

replace:
.php_to8bit().php_urlencode()

with:
.html_entity_decode.php_urlencode()

That works perfect ...

Arantor

Don't you want brackets on the decode call?

feline

No .. this I have tested with a Android handy/tablet and a MS Lumia ..
Works perfect ...  ;)

albertlast

what is the motivation for doing this decode/encode stuff?
Because this stuff cost cpu and traffic.

Arantor

I'm not sure but I genuinely don't see how that snippet works correctly. Maybe it ends up doing the same as the 2.1 equivalent change ;D

Gluz

It doesn't, it throws JavaScript error about html_entity_decode not being defined if used without brackets, and that is not a function with brackets.

That part it's failing to do anything.

If you just use the fix for 2.1, it works the same but without errors.

feline

Prewiev Screenshot without html_entity_decode (not_correct)

Preview Screenshot width html_entity_decode (correct)

More questions?

Arantor

I'm just struggling to understand how a JavaScript property can be called as a function without using the operator to tell it to use it as a function.

In other words, as gluz said.

Now, if you had the brackets in there as I suggested, I could see it maybe working.

Gluz

That preview without html_entity_decode have php_urlencode or not?

Where it's defined html_entity_decode in SMF? because the JavaScript console says it's not defined.

With the github fix it displays the Emojis fine in a brand new SMF install, and with your code it displays the Emojis but also generate that error in the JavaScript console.

shawnb61

This was reported a few times & a fix is targeted for 2.0.16 - I am going to close some dupes & keep one open:
https://www.simplemachines.org/community/index.php?topic=569620.0
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Advertisement: