Jump to content

Encoded string problem.


mraiur

Recommended Posts

Hi i have to make a rss veed that has to be made in two encodings everything is working but when i preview the rss -> "An invalid character was found in text content" .

And when i saw the code there where "?" or "!" or "~!" something like this . And when i searched to find some answears it was a bug in PHP 4 that is fixed in PHP 5 but the problem is that the servers the feed is on my boss still refuse to upgrade to PHP 5 .

So is there any way to overcome this problem?

BTW: 1-encoding is UTF-8 and 2-encoding windows-1251

thx all

Link to comment
https://forums.phpfreaks.com/topic/105423-encoded-string-problem/
Share on other sites

its to much code to show i mean 1 i made was to cache all other is to read .

and the main problem is that a sentence witch is for example in bulgarian in utf-8 is 8 symbols  "Бългаски" but strlen shows its 16 symbols and substring for example cuts the string in the starting of the symbol ... i think :(

yea :(

 

That didn't really answer my question, but it's ok, I'm pretty sure I understand your problem. You will need to enable the mbstring (multi-byte string) library in php (it's not usually enabled by default), and then use the mbstring functions to cut the feed at 100 characters. This should solve your problem.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.