1
manik
Contact us module - how to involve "charset=windows-1250"
  • 2005/5/17 13:37

  • manik

  • Just popping in

  • Posts: 8

  • Since: 2003/2/26


Hello.

My name is Vladimir and I am from Slovakia. Our language have several special characters (for example ž,š,č,ť,ý), therefore I have to use coding "charset=windows-1250". I am using XOOPS for non commerce sites MCPO - ďalšie vzdelávanie učiteľov. In standard module of XOOPS system - Contact us I write something into Text field, but if I recieve e-mail than, I get "□", instead of "ž".

How to involve central European coding "charset=windows-1250" into Contact us module?

I hope you understand me.
Thank you for help.

**
Vladimír
AmiPlus - účtovníctvo, ekonomický software

2
rowdie
Re: Contact us module - how to involve "charset=windows-1250"
  • 2005/5/17 15:11

  • rowdie

  • Just can't stay away

  • Posts: 846

  • Since: 2004/7/21


I think the problem isn't just with the contact us module, it would be with all emails.

See if you have a file called xoopsmailerlocal.php at your xoops_url/language/[your language]/

- if the file exists, make sure there's a line that looks like:
Quote:
$this->charSet = 'windows-1250';


- if the file doesn't exist, make one. Put the following in the file:

class XoopsMailerLocal extends XoopsMailer {

    function 
XoopsMailerLocal(){
        
$this->XoopsMailer();
        
$this->charSet 'windows-1250';
    }
}
?>

and save it as xoopsmailerlocal.php in your core language folder.

You may also need to change the locale. I'm certainly no expert, but I've read that some languages need to set the locale for the mailer to function correctly.

You can set the locale in the xoops_url/language/[your language]/global.php file.

define('_CHARSET''windows-1250');
define('_LANGCODE''sk');

$original_locale setlocale(LC_ALL0);
if (!
setlocale(LC_ALL'sk')) {
    
setlocale(LC_ALL$original_locale );
}


I hope this helps...

Rowd

3
manik
Re: Contact us module - how to involve "charset=windows-1250"
  • 2005/5/19 10:41

  • manik

  • Just popping in

  • Posts: 8

  • Since: 2003/2/26


Thank you, it works!

**
-Vladimir.
AmiPlus - účtovníctvo, ekonomický software

4
gediminasbyt
Re: Contact us module - how to involve "charset=windows-1250"

Thanks rowdie for help in this forum but I'm getting nowhere yet.

I have created this file but when I send message I do get:

ass XoopsMailerLocal extends XoopsMailer { function XoopsMailerLocal(){ $this->XoopsMailer(); $this->charSet = 'utf-8'; } } ?>

But email still is in iso-8859-1 format.

By the way I'm using xoops2.2 and php5

5
gediminasbyt
mail sent in utf-8

Just trying to keep the post alive because there must be someone who would know what's going on with utf-8 email encoding. Why emails show up as 8859-1 encoded not utf-8. Where is place for propper setting?

6
gediminasbyt
Re: mail sent in utf-8

I found iso-8859-1 references in these 2 files and replaced them to utf-8. After what emails are being mailed in utf-8 format.

class/mail/phpmailer/class.phpmailer.php
class/xoopsmailer.php

Can someone tell me what each file is for. Both are for mail but where each class is used at? And should I have changed them both to utf-8.

7
rowdie
Re: mail sent in utf-8
  • 2005/8/8 17:54

  • rowdie

  • Just can't stay away

  • Posts: 846

  • Since: 2004/7/21


Those core files set a default value for the email encoding. The method I outlined in this thread is the way XOOPS core translations can change that default value to something else.

Changing the core files won't break anything, so the way you did it will be ok. Just remember to hack the same way for any upgrades

It would be easier if you could manage to get the xoopsmailerlocal.php file working, then you don't need to worry with upgrades - it stays with your core language files.

Are you sure you followed the directions exactly? Copy and pasted the code to a new file, called it xoopsmailerlocal.php and put it in your core language folder?

Ah well, at least you got your email encoding to work - that's good to hear

8
gediminasbyt
Re: mail sent in utf-8

You know I feel ashamed

I'm using vi therefore I did not pay too much attention when i was pasting code to it. This what was pasted in
Quote:

ass XoopsMailerLocal extends XoopsMailer { function XoopsMailerLocal(){ $this->XoopsMailer(); $this->charSet = 'utf-8'; } } ?>


When I saw "ass" I was like whatever, but when you confirmed that this patch should work I decided to look once more at this file where I found out that it was incomplete... ass was showing up instead of class

Thanks rowdie.

Login

Who's Online

194 user(s) are online (94 user(s) are browsing Support Forums)


Members: 0


Guests: 194


more...

Donat-O-Meter

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

Latest GitHub Commits