Jump to content
  • 0

Charset problem with FluxCP and SSI


Daegaladh

Question


  • Group:  Developer
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  230
  • Reputation:   131
  • Joined:  11/21/11
  • Last Seen:  

Hi, I'm doing my website based on flux, and started adding a news system using SSI.php from my SMF forum, all works fine (I did this a lot of times in common websites), except a weird thing:

Paragraphs with symbols like ¿¡áéíóú, disappears, or appears as "?", although I've set the header as UTF-8, and all my files are enconded to UTF-8 without bom.

I've tried to load only my template, without flux flunctions, and works fine, so it seems Flux is screwing up something...

Any ideas?

Thanks

Edited by Daegaladh
Link to comment
Share on other sites

10 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  169
  • Topics Per Day:  0.04
  • Content Count:  1260
  • Reputation:   750
  • Joined:  11/19/11
  • Last Seen:  

try changing the charset to iso-8859-1, if even that doesn't fix then flux might be encoding at some code area, for example with mysql_set_charset

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  230
  • Reputation:   131
  • Joined:  11/21/11
  • Last Seen:  

Doesn't work... I've tried to send the header directly from ssi.php, from themes/default/main/index.php too... a lot of things... nothing seems to work, I'm tottaly lost :S

I've searched with ultraedit inside all files for things that could be screwing up the charset and found nothing unusual...

Edit: I've tried htmlspecialchars($news['subject']) that is supposed to change special characters to html code, like á and still appears as "?"... this has nosense .___.

Seems flux change the text AFTER it's obtained from SSI... WTF?

Edited by Daegaladh
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  230
  • Reputation:   131
  • Joined:  11/21/11
  • Last Seen:  

Still can't fix it :S

Please, anybody have ever done a FluxCP+SMF integration can tell how to do it? Maybe I'm doing something wrong :S

Thanks :(

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  243
  • Reputation:   206
  • Joined:  11/28/11
  • Last Seen:  

I'll see if I can reproduce... testing

Edit:

I was able to reproduce, but Ind's suggestion fixed it. In your theme's fluxCP header file, change the meta tag so it reads:

<meta http-equiv="Content-Type" content="text/html; charset="iso-8859-1" />

FluxCP Test: http://work.x-services.info/web/cp/

SMF Test: http://work.x-servic...1;topicseen#new

Edit2:

Some functions, such as ssi_recentTopics, work fine with the fix above.However, other functions like ssi_boardNews that fetches the post, uses the function parse_bbc. Inside this function, found in the file /smf/Sources/Subs.php, it uses utf-8 as it's charset. You can pretty much just find and replace it with the iso one. If you want the editted file, let me know =)

Not sure if there are any other exceptions.

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  230
  • Reputation:   131
  • Joined:  11/21/11
  • Last Seen:  

Yes, it works but isn't a solution, it fix the news, but broke the rest of my web because it's coded in utf-8... XD

I need Flux to get the news directly in utf-8, but dunno how...

I have no idea why is not receiving the news correctly.. if you make a simple web to test using utf-8, and loading news from SSI, it works perfectly... it get the news in utf-8 and show them correctly...

But not in flux! ,___, seems somehow it suddenly changes into iso-8859-1... why? ._.

Thanks anyway :)

Edited by Daegaladh
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  633
  • Reputation:   78
  • Joined:  11/14/11
  • Last Seen:  

I found this in php.net

string utf8_encode ( string $data )

Source: http://php.net/manua...utf8-encode.php

maybe you can use this

Edited by JayPeeMateo
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  230
  • Reputation:   131
  • Joined:  11/21/11
  • Last Seen:  

I did and doesn't work...

At the moment I'm trying in another way, changing the place require_once("SSI.php") is placed (it's supposed that it needs to be somewhere before the html label http://docs.simplema...0#post_ssi_call). I've tried to put it in the root index.php, on flux.php and some other places, and when I did it worked, but leaves a lot of error because headers from smf and flux are colliding:

Notice: SSI.php was unable to load a session! This may cause problems with logout and other functions - please make sure SSI.php is included before *anything* else in all your scripts! in /x/x/x/forum/SSI.php on line 170

Warning: Cannot modify header information - headers already sent by (output started at /x/x/x/forum/Sources/Load.php(2155) : eval()'d code:1) in /x/x/x/flux/lib/Flux/Template.php on line 233

Warning: ini_set() [ref.outcontrol]: Cannot change zlib.output_handler - headers already sent in /x/x/x/flux/lib/Flux/Template.php on line 234

Warning: ini_set() [ref.outcontrol]: Cannot change zlib.output_compression - headers already sent in /x/x/x/flux/lib/Flux/Template.php on line 235

Any ideas about where it should be placed?

Edited by Daegaladh
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  633
  • Reputation:   78
  • Joined:  11/14/11
  • Last Seen:  

Try to put it in the index.php. I dont know if fluxCP use session_start() my is guess is it is using database driven session. May I know what are you trying to do?

Edited by JayPeeMateo
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  230
  • Reputation:   131
  • Joined:  11/21/11
  • Last Seen:  

Hi, I'm doing my website based on flux, and started adding a news system using SSI.php from my SMF forum

I already tried to put it in different places into index.php, but it only gives me different errors...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  633
  • Reputation:   78
  • Joined:  11/14/11
  • Last Seen:  

Why not use a RSS Feeds if there is in SMF?

Link to comment
Share on other sites

×
×
  • Create New...