context_title
context_text
Topic Summary - Displaying 7 post(s). Click here to show all
Posted by: Monni Posted on: Sep 2nd , 2014 at 4:41pm
I promised I won't give up until I find where it goes wrong
Posted by: Dandello Posted on: Sep 2nd , 2014 at 1:36pm
Good job
Posted by: Monni Posted on: Sep 2nd , 2014 at 9:28am
Dandello wrote on Sep 2
nd , 2014 at 4:29am:
Thanks - that's what happens when I hurry.
I know... It took me a while after I upgraded Perl to figure out what was the root cause of the encoding issues... Then it was just cleaning up the code and redoing LivePreview.pm to do the conversion the right way
Posted by: Dandello Posted on: Sep 2nd , 2014 at 4:29am
Thanks - that's what happens when I hurry.
Posted by: Monni Posted on: Sep 2nd , 2014 at 3:52am
I think you messed up one line in the patch:
Index: cgi-bin/yabb2/Sources/LivePreview.pm
===================================================================
--- cgi-bin/yabb2/Sources/LivePreview.pm (revision 1559)
+++ cgi-bin/yabb2/Sources/LivePreview.pm (working copy)
@@ -80,7 +80,7 @@
$myname = $FORM{'guestname'};
uri_unescape($myname);
if ( $yymycharset ne 'UTF-8' ) {
- $csubject = decode_utf8($myname);
+ $myname = decode_utf8($myname);
}
$myname =~ s/[\r\n]//gsm;
FromChars($myname);
Posted by: Monni Posted on: Sep 1st , 2014 at 12:30am
Part 2/2:
Index: cgi-bin/yabb2/Sources/YaBBC.pm
===================================================================
--- cgi-bin/yabb2/Sources/YaBBC.pm (revision 1557)
+++ cgi-bin/yabb2/Sources/YaBBC.pm (working copy)
@@ -20,9 +20,6 @@
LoadLanguage('Post');
$yyYaBBCloaded = 1;
-if ( $yymycharset ne 'UTF-8' ) {
- use HTML::Entities;
-}
sub MakeSmileys {
my ($inp) = @_;
@@ -106,7 +103,7 @@
else {
$fqauthor = decloak($qauthor);
- # if all fails it is a non existing real name so decode and asign as screenname
+ # if all fails it is a non-existing real name so decode and assign as screenname
}
}
else {
@@ -132,9 +129,6 @@
$qmessage = parseimgflash($qmessage);
$qdate = timeformat($qdate,0,0,0,1); # generates also the global variable $daytxt
- if ( $yymycharset ne 'UTF-8' ) {
- encode_entities($qdate, "\200-\377"); # escape high ASCII
- }
$cssbg = $ycssvalues[ ( $ycsscounter % $ycssnum ) ];
$ycsscounter++;
if ( $fqauthor eq q{} || $qlink eq q{} || $qdate eq q{} ) {
This fixes it good... No more hacks
Posted by: Monni Posted on: Aug 31st , 2014 at 10:06pm
Index: cgi-bin/yabb2/Sources/LivePreview.pm
===================================================================
--- cgi-bin/yabb2/Sources/LivePreview.pm (revision 1557)
+++ cgi-bin/yabb2/Sources/LivePreview.pm (working copy)
@@ -22,6 +22,9 @@
$livepreviewpmver = 'YaBB 2.6.0 $Revision$';
if ( $action eq 'detailedversion' ) { return 1; }
use URI::Escape;
+if ( $yymycharset ne 'UTF-8' ) {
+ use Encode;
+}
LoadCensorList();
guard();
if ( $enable_ubbc ) {
@@ -35,6 +38,9 @@
$FORM{'message'} =~ s/\r//gsm;
$message = $FORM{'message'};
uri_unescape($message);
+ if ( $yymycharset ne 'UTF-8' ) {
+ $message = decode_utf8($message);
+ }
$message =~ s/\[ch8203\]//igsm;
$message =~ s/\//igsm;
FromChars($message);
@@ -58,6 +64,9 @@
$message = Censor($message);
$csubject = $FORM{'subject'};
uri_unescape($csubject);
+ if ( $yymycharset ne 'UTF-8' ) {
+ $csubject = decode_utf8($csubject);
+ }
$csubject =~ s/[\r\n]//gsm;
FromChars($csubject);
$convertstr = $csubject;
@@ -70,11 +79,19 @@
liveimage_resize();
$myname = $FORM{'guestname'};
uri_unescape($myname);
+ if ( $yymycharset ne 'UTF-8' ) {
+ $myname = decode_utf8($myname);
+ }
$myname =~ s/[\r\n]//gsm;
FromChars($myname);
ToHTML($myname);
ToChars($myname);
$myname = Censor($myname);
+ if ( $yymycharset ne 'UTF-8' ) {
+ $csubject = encode_utf8($csubject);
+ $message = encode_utf8($message);
+ $myname = encode_utf8($message);
+ }
print "Content-type: application/x-www-form-urlencoded\n\n"
or croak "$croak{'print'} content-type";
print qq~$csubject|$message|$myname~ or croak "$croak{'print'}";
@@ -87,6 +104,9 @@
$FORM{'message'} =~ s/\r//gxsm;
$message = $FORM{'message'};
uri_unescape($message);
+ if ( $yymycharset ne 'UTF-8' ) {
+ $message = decode_utf8($message);
+ }
$message =~ s/\[ch8203\]//igsm;
$message =~ s/\//igsm;
FromChars($message);
@@ -111,6 +131,9 @@
$message = Censor($message);
$csubject = $FORM{'subject'};
uri_unescape($csubject);
+ if ( $yymycharset ne 'UTF-8' ) {
+ $csubject = decode_utf8($csubject);
+ }
$csubject =~ s/[\r\n]//gsm;
FromChars($csubject);
$convertstr = $csubject;
@@ -143,6 +166,9 @@
liveimage_resize();
+ if ( $yymycharset ne 'UTF-8' ) {
+ $messageblock = encode_utf8($messageblock);
+ }
print "Content-type: application/x-www-form-urlencoded\n\n"
or croak "$croak{'print'} content-type";
print qq~$messageblock\n~ or croak "$croak{'print'} messageblock";
@@ -152,9 +178,12 @@
sub DoLiveCal {
LoadLanguage('EventCal');
- $FORM{'message'} =~ s/\r//gxsm;
$message = $FORM{'message'};
uri_unescape($message);
+ if ( $yymycharset ne 'UTF-8' ) {
+ $message = decode_utf8($message);
+ }
+ $message =~ s/\r//gxsm;
$message =~ s/\[ch8203\]//igsm;
$message =~ s/\//igsm;
FromChars($message);
@@ -181,6 +210,9 @@
CountChars();
$myname = $FORM{'guestname'};
uri_unescape($myname);
+ if ( $yymycharset ne 'UTF-8' ) {
+ $myname = decode_utf8($myname);
+ }
$myname =~ s/[\r\n]//gsm;
FromChars($myname);
ToHTML($myname);
@@ -198,6 +230,12 @@
$mybtime = stringtotime(qq~$d_mon/$d_day/$d_year~);
$mybtimein = timeformat($mybtime);
$cdate = dtonly($mybtimein);
+ if ( $yymycharset ne 'UTF-8' ) {
+ $message = encode_utf8($message);
+ $myname = encode_utf8($myname);
+ $cdate = encode_utf8($cdate);
+ $txt_icon = encode_utf8($txt_icon);
+ }
print "Content-type: application/x-www-form-urlencoded\n\n"
or croak "$croak{'print'} content-type";
print qq~$message|$myname|$cdate|$txt_icon|$mycal_type~
To be continued on next post...
Forum Jump »
Board Index
» 10 most recent Posts
» 10 most recent Topics
News and Updates
YaBB News
General Category
General Board
Test Zone
- Test Sub
- Test sub 2
Showcase
Archived Development Forums
- http://www.yabb26.yabbforumsoftware.com/
YaBB Development
HTML5 and CSS
SQL - yes, we're heading there
New Features
Documentation
On the Road to 2.7
Lounge
Talk it Up
The Comedy Club
Support
Security Announcements
YaBB 2.6.0 and 2.6.1 Support
Other Places
- http://www.yabbforum.com/
- https://www.facebook.com/YaBBForum/
- http://yabbmain.yabbforumsoftware.com/cgi-bin/community/YaBB.pl
Converting to other software
Mod Spot
Mods Wanted (Old Mods)
Mods Wanted (New Mods)
2.6.1 Mods
2.6.0 Mods
- http://www.xonder.com/cgi-bin/yabb26/YaBB.pl
- http://boardmod.de
- http://www.boardmod.org/cgi-bin/forum/YaBB.pl
- http://boardmod26.yabbforumsoftware.com/cgi-bin/yabb2/YaBB.pl
2.5.2 Mods
2.7.00 Mods
- http://yabbforumsoftware.com/cgi-bin/modlang/modlang.pl
Templates for 2.7
Helps
YaBB Administration
Language Packs (2.6)
- Suomi
- Русский
- Deutsch
Language Packs (2.7)
http://yabbforumsoftware.com/cgi-bin/langfix/complang.pl
Bug Zone
YaBB Bugs ««
YaBB 2.7 Issues