1
xjih78
cp1251 encoding problem
  • 2007/3/28 19:21

  • xjih78

  • Just popping in

  • Posts: 5

  • Since: 2007/3/28


I entered my encoding in the global.php and the same is with the database for the portal and there's no problem with displaying these characters except when i submit text and what comes out are "?" which replace the letters. any ideas?

2
InnoSense
Re: cp1251 encoding problem
  • 2007/3/29 3:10

  • InnoSense

  • Just popping in

  • Posts: 25

  • Since: 2006/10/2


In <xoops_root>/class/database/database.php
SET NAMES to CP1251

function prefix($tablename='')
{
if ( $tablename != '' ) {
return $this->prefix .'_'. $tablename;
$this->prefix = $table_prefix;
@mysql_query("SET NAMES 'cp1251'", $this->_resource);

3
InnoSense
Re: cp1251 encoding problem
  • 2007/3/29 3:12

  • InnoSense

  • Just popping in

  • Posts: 25

  • Since: 2006/10/2


And you may insert these lines into php.ini:

AddDefaultCharset = cp1251
CHARSET = cp1251
default_charset = cp1251
mbstring.internal_encoding = cp1251
default_charset = cp1251
collation_server = cp1251

4
xjih78
Re: cp1251 encoding problem
  • 2007/3/29 10:58

  • xjih78

  • Just popping in

  • Posts: 5

  • Since: 2007/3/28


I edited the database.php file, added this to the function so it's like that:
Quote:

function prefix($tablename='')
{
return $this->prefix .'_'. $tablename;
$this->prefix = $table_prefix;
@mysql_query("SET NAMES 'cp1251'", $this->_resource);
if ( $tablename != '' ) {
return $this->prefix .'_'. $tablename;
} else {
return $this->prefix;
}
}
}
}

and added the lines in php.ini, restarted the server and it is the same.

5
InnoSense
Re: cp1251 encoding problem
  • 2007/4/1 18:04

  • InnoSense

  • Just popping in

  • Posts: 25

  • Since: 2006/10/2


In the end of <xoops_root>/language/<your lang>/global.php

set:

define('_CHARSET', 'cp1251');
define('_LANGCODE', '<your lancode>');

Login

Who's Online

259 user(s) are online (179 user(s) are browsing Support Forums)


Members: 0


Guests: 259


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits