Advertisement:

Author Topic: Help Needed From Character Encoding Expert  (Read 621 times)

Offline j_jindal1

  • Jr. Member
  • **
  • Posts: 104
    • Shayri forum of Friends
Help Needed From Character Encoding Expert
« on: August 01, 2020, 09:31:29 AM »
Need expert advice on the issue below...

I'm trying to display SMF posts on wordpress page... For english characters all works well, but things are messed up with non-english characters like regional languages...

See the post on WP page here...
 
http://shayarfamily.com/test/

Actual post in SMF

https://shayarfamily.com/shayari/love-shayri-in-english-and-other-regional-languages/t224/

P.S. Installation of SMF and WP is on same DB and collation is also same now ("utf8_general_ci"), initially WP tables collation was "utf8mb4_unicode_520_ci" and SMF tables was "utf8_general_ci"

I've already tried...
changing database collation from utf8_general_ci to utf8mb4_unicode_520_ci and vice versa... converting imported post to UTF-8 using encode_utf and decode_utf php functions...

mb_convert_encoding with diff charsets on imported data but results were not good.. :(

Plz help guys....
www.ShayarFamily.com Shayri forum of Friends

Offline j_jindal1

  • Jr. Member
  • **
  • Posts: 104
    • Shayri forum of Friends
Re: Help Needed From Character Encoding Expert
« Reply #1 on: August 02, 2020, 12:38:38 PM »
no-one..  :( :(
www.ShayarFamily.com Shayri forum of Friends

Offline shawnb61

  • Developer
  • SMF Hero
  • *
  • Posts: 2,115
    • sbulen on GitHub
Re: Help Needed From Character Encoding Expert
« Reply #2 on: August 02, 2020, 03:07:54 PM »
It looks like your SMF site is properly dealing with UTF8, but your wp site is not. 

You may need to turn to WP support? 

A quick search reveals others have had similar issues.  Some of their suggested solutions look dodgy to me, but then again, I dunno WP:
https://wordpress.stackexchange.com/questions/156626/strange-characters-despite-everything-being-utf-8
https://www.tipsandtricks-hq.com/how-to-fix-the-character-encoding-problem-in-wordpress-1480

« Last Edit: August 02, 2020, 03:41:42 PM by shawnb61 »
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Offline j_jindal1

  • Jr. Member
  • **
  • Posts: 104
    • Shayri forum of Friends
Re: Help Needed From Character Encoding Expert
« Reply #3 on: August 04, 2020, 07:40:29 AM »
Thanks for your reply.

I'm checking those links if it works... :)
www.ShayarFamily.com Shayri forum of Friends

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 72,804
    • StoryBB/StoryBB on GitHub
Re: Help Needed From Character Encoding Expert
« Reply #4 on: August 04, 2020, 08:26:10 AM »
What did you do to get the SMF content into WP exactly?
Please don’t PM me for paid work, I’m not for hire, and even if I was, I doubt you could afford me.
USD$150 per hour. Typical waiting list 3 months.

Offline j_jindal1

  • Jr. Member
  • **
  • Posts: 104
    • Shayri forum of Friends
Re: Help Needed From Character Encoding Expert
« Reply #5 on: August 05, 2020, 01:27:15 AM »
What did you do to get the SMF content into WP exactly?
Thanks for replying, I somewhat fixed it but still need help with other issue.

I was fetching the data using smc functions. This is what I did in an addon php script.

1.  require ("smf_installation/SSI.php");
2.  $smcFunc['db_query']
3.  while ($row = $smcFunc['db_fetch_assoc']($result))

Since the above steps didn't' give correct results, I used $WPDB object of wordpress to fetch data... Now there are no more special characters. But the issue is "data is being printed with BBCODES".

[ size=15pt][ color=brown]अपनी मधहोश निगाहो से सवेरा करना[ /size][ /color]

instead of [ size=15pt][ color=brown] I want appropriate html tags. Could you please guide..
www.ShayarFamily.com Shayri forum of Friends

Offline j_jindal1

  • Jr. Member
  • **
  • Posts: 104
    • Shayri forum of Friends
Re: Help Needed From Character Encoding Expert
« Reply #6 on: August 05, 2020, 01:44:19 AM »
Thanks Arantor, Thanks shawnb61 for taking time to reply in this thread. The issue is resolved now.

For anyone else facing similar issue... the solution is fetching the raw data from database and then using parse_bbc function.
www.ShayarFamily.com Shayri forum of Friends