BoardMod - YaBB features and templates   YaBB Codex - support on installation and usage   YaBB Toolbar for your browser
  Welcome, Guest. Please Login or Register


YaBB - Yet another Bulletin Board
 
 
 
  Home Support Codex BoardMod HelpLoginRegisterSearch  
 
Page Index Toggle Pages: 1
Print
charset problem (Read 2054 times)
Oct 29th, 2008 at 11:48am

Velocity   Offline
Junior Member
Ìîñêâà

Posts: 98
**
 
I try to use version 2.3 with Russian Language and find some problem in charset windows-1251 (possible in another charsets). See image below.
If I try to translate "Send Email to" in Russian I get unreadable letters.
 

email_bug.jpg (50 KB | 77 )
email_bug.jpg
IP Logged
 
Reply #1 - Oct 29th, 2008 at 5:49pm

deti   Offline
Legacy Dev Team
Development Team
Prien am Chiemsee, Germany

Posts: 2643
****
 
Velocity wrote on Oct 29th, 2008 at 11:48am:
If I try to translate "Send Email to" in Russian I get unreadable letters.

Can you also post an image what you get when you translate it?
 

Was immer Du tun kannst
oder erträumst tun zu können,
beginne es.
Kühnheit besitzt Genie,
Macht und magische Kraft.
Beginne es jetzt.
Whatever you can do
or dream you can,
begin it.
Boldness has genius,
power and magic in it.
Begin it now.
J. W. Goethe
IP Logged
 
Reply #2 - Nov 5th, 2008 at 11:10am

Velocity   Offline
Junior Member
Ìîñêâà

Posts: 98
**
 
deti wrote on Oct 29th, 2008 at 5:49pm:
Can you also post an image what you get when you translate it?


Yes.

Trouble probably in function enc_eMail, in /yabb2/Sources/Subs.pl
This function uncorrectly encoding when string contain not latinic symbols.

Trouble temporary fixed in /yabb2/Sources/Profile.pl (Same situation in User Profile)

Code:
#by Fduch			$rowEmail = &enc_eMail("$profile_txt{'889'} ${$uid.$user}{'realname'}",${$uid.$user}{'email'},'','');
#		}
#
#		$row_email = qq~
#		<div style="float: left; clear: left; width: 30%; padding-top: 5px; padding-bottom: 5px;">
#		<b>$profile_txt{'69'}: </b>
#		</div>
#		<div style="float: left; width: 70%; padding-top: 5px; padding-bottom: 5px;">
#		$rowEmail
#		</div>
#		~;
			$rowEmail = &enc_eMail("${$uid.$user}{'realname'}",${$uid.$user}{'email'},'','');#
		}
 		$row_email = qq~
		<div style="float: left; clear: left; width: 30%; padding-top: 5px; padding-bottom: 5px;">
		<b>$profile_txt{'69'}: </b>
		</div>
		<div style="float: left; width: 70%; padding-top: 5px; padding-bottom: 5px;">
		$profile_txt{'889'} $rowEmail
		</div>
		~;
  



...
« Last Edit: Nov 5th, 2008 at 2:14pm by Velocity »  

email_bug2.jpg (38 KB | 54 )
email_bug2.jpg
IP Logged
 
Reply #3 - Nov 6th, 2008 at 1:33pm

deti   Offline
Legacy Dev Team
Development Team
Prien am Chiemsee, Germany

Posts: 2643
****
 
Right Velocity!

Now, can you do a test for me?

- Undo your changes in last post.
- replace the sub enc_eMail in Subs.pl by the following code:
Code:
sub enc_eMail {
	my ($title,$email,$subject,$body) = @_;
	my $charset_value = 848 if $yycharset eq "windows-1251"; # Cyrillic

	my $email_length = length($email);
	my $code1 = &generate_code($email_length);
	my $code2;
	for (my $i = 0; $i < $email_length; $i++) {
		$code2 .= chr((ord(substr($code1,$i,1))^ord(substr($email,$i,1))));
	}
	$code2 = &uri_escape($code2);

	my $subbody;
	if ($subject or $body) {
		$subject = &uri_escape($subject);
		$body = &uri_escape($body);
		$subbody = "?subject=$subject&body=$body";
		$subbody =~ s/(((<.+?>)|&#\d+;)|.)/ &enc_eMail_x($1,$2,$3) /eg;
	}

	$title =~ s/(((<.+?>)|&#\d+;)|.)/ &enc_eMail_x($1,$2,$3) /eg;

	return qq*<script type='text/javascript'>\n<!--\nSpamInator("$title","$code1","$code2","&#109;&#97;&#105;&#108;&#92;&#117;&#48;&#48;&#55;&#52;&#111;&#92;&#117;&#48;&#48;&#51;&#97;","$subbody");\n-->\n</script><noscript>$maintxt{'noscript'}</noscript>*;

	sub enc_eMail_x  {
		my ($x,$y,$z) = @_;
		if (!$y) {
			$x = ord($x);
			$x += $charset_value if $charset_value && $x > 126;
			$x = "&#$x";
		} elsif ($z) {
			$x =~ s/"/\\"/g;
		}
		$x;
	}
} 


Report me.

Thanks! Wink
 

Was immer Du tun kannst
oder erträumst tun zu können,
beginne es.
Kühnheit besitzt Genie,
Macht und magische Kraft.
Beginne es jetzt.
Whatever you can do
or dream you can,
begin it.
Boldness has genius,
power and magic in it.
Begin it now.
J. W. Goethe
IP Logged
 
Reply #4 - Nov 7th, 2008 at 2:56am

Velocity   Offline
Junior Member
Ìîñêâà

Posts: 98
**
 
@
 deti

Thank you. It's work well in both cases.
 
IP Logged
 
Reply #5 - Nov 7th, 2008 at 10:59am

deti   Offline
Legacy Dev Team
Development Team
Prien am Chiemsee, Germany

Posts: 2643
****
 
OK, thank you too!

New Subs.pl in CVS.
(I uploaded yesterday already.)
 

Was immer Du tun kannst
oder erträumst tun zu können,
beginne es.
Kühnheit besitzt Genie,
Macht und magische Kraft.
Beginne es jetzt.
Whatever you can do
or dream you can,
begin it.
Boldness has genius,
power and magic in it.
Begin it now.
J. W. Goethe
IP Logged
 
Reply #6 - Nov 7th, 2008 at 10:59am

deti   Offline
Legacy Dev Team
Development Team
Prien am Chiemsee, Germany

Posts: 2643
****
 
This Topic was moved here from YaBB 2 - Bugs [Need Verification] by deti.
 

Was immer Du tun kannst
oder erträumst tun zu können,
beginne es.
Kühnheit besitzt Genie,
Macht und magische Kraft.
Beginne es jetzt.
Whatever you can do
or dream you can,
begin it.
Boldness has genius,
power and magic in it.
Begin it now.
J. W. Goethe
IP Logged
 
Page Index Toggle Pages: 1
Print