Author Topic: Could not convert string from WIN-1251 to UTF-8  (Read 3430 times)

Offline Makc666

  • Jr. Member
  • **
  • Posts: 23
    • http://makc666.com
Could not convert string from WIN-1251 to UTF-8
« on: April 19, 2010, 12:42:12 PM »
P.S. Didn't want to make a mess in thread [THREAD]5713[/THREAD].

In logs/errors file I see this one:

Code: [Select]
[19-Apr-2010 20:19:36 +0400]: PHP Error: Could not convert string from WIN-1251 to UTF-8. Make sure iconv/mbstring is installed or lib/utf8.class is available. in /usr/local/www/www.webmail.starnet.ru/program/include/main.inc on line 279 (GET /?_task=mail&_action=preview&_uid=2&_mbox=INBOX)First, I have checked the directory:
/program/lib/encoding/
There is no any file starting with name WIN-1251.

Second, I have checked the file:
/program/lib/utf8.class.php

I was only able to find the line with this code:
$charset preg_replace(array('/^WINDOWS-*125([0-8])$/''/^CP-/'), array('CP125\\1''CP'), $charset);But again no any code for name WIN-1251.

The question is...
The error I see can be because the /program/lib/utf8.class.php file just has no any string (code) for WIN-1251?

May be I can fix that error just by adding one more line (second line) like:
$charset preg_replace(array('/^WIN-*125([0-8])$/''/^CP-/'), array('CP125\\1''CP'), $charset);So the final code will be:
$charset preg_replace(array('/^WINDOWS-*125([0-8])$/''/^CP-/'), array('CP125\\1''CP'), $charset);
$charset preg_replace(array('/^WIN-*125([0-8])$/''/^CP-/'), array('CP125\\1''CP'), $charset);
Is the direction of my thoughts right?
« Last Edit: January 12, 2012, 09:24:30 AM by Makc666 »
...... ...... "А стукачков мы не любим!"

Offline oldschool

  • Sr. Member
  • ****
  • Posts: 406
Could not convert string from WIN-1251 to UTF-8
« Reply #1 on: April 19, 2010, 03:20:41 PM »
Use wikipedia or Google  and search for "WIN-1251"!
READ the found pages.

Now it should be clear why you don´t found any file/s named "WIN-1251"...



Rgds.

Offline Makc666

  • Jr. Member
  • **
  • Posts: 23
    • http://makc666.com
Could not convert string from WIN-1251 to UTF-8
« Reply #2 on: April 21, 2010, 03:42:15 AM »
Quote from: oldschool;26871
Use wikipedia or Google  and search for "WIN-1251"!
READ the found pages.

Now it should be clear why you don´t found any file/s named "WIN-1251"...



Rgds.

If you don't want to post a clear answers then better don’t post anything.

I know that there is no any official naming for codepage win-1251.
But we talk about the convenience of our users.
If some stupid email client set the naming of code page not 100% correctly the users must not suffer for this fact.
« Last Edit: January 12, 2012, 09:24:54 AM by Makc666 »
...... ...... "А стукачков мы не любим!"