Fedora Linux Support Community & Resources Center
  #1  
Old 25th March 2004, 01:31 PM
Nik Offline
Registered User
 
Join Date: Mar 2004
Location: Thessaloniki
Age: 37
Posts: 11
font problem in fedora with browsers

hello i use fedora core 1

My website was made in perl and when it runs it opens some greek text files which then tries to display them in browser. The problem is that when i try to view my perl website with firefox it cannot display all of my greek fonts but only a few of them!

I have installed greek support in fedora.

what might be the problem? can you helpme out here please?
__________________
The Devil Is In The Details!
Reply With Quote
  #2  
Old 25th March 2004, 01:59 PM
Jman Offline
Registered User
 
Join Date: Mar 2004
Location: Minnesota, USA
Age: 28
Posts: 7,909
Have you tried messing with Mozilla/Firefox's character encoding? View > Character Encoding.
Reply With Quote
  #3  
Old 25th March 2004, 07:30 PM
Nik Offline
Registered User
 
Join Date: Mar 2004
Location: Thessaloniki
Age: 37
Posts: 11
yes i did and as a matter of fact i can see greek pages but especially my one www.nikolas.tk i cannot see the greek that displays!

can you?

must i install fonts somehow?
__________________
The Devil Is In The Details!
Reply With Quote
  #4  
Old 26th March 2004, 12:00 AM
Jman Offline
Registered User
 
Join Date: Mar 2004
Location: Minnesota, USA
Age: 28
Posts: 7,909
I can see your site, but it's all Greek to me.

Font settings on Mozilla are under Edit > Preferences, Appearance, Fonts. Maybe you are using some fonts that lack Greek characters. Fortunately the Mozilla fonts seem to use Unicode and can display all kinds of characters. What encoding is the origional text in?

The weird thing is if view the properties of your site the language appears to be US English! I don't autodetect the encoding.

Do any other browsers work?

Hope these ramblings lead you to an idea.
Reply With Quote
  #5  
Old 26th March 2004, 12:42 AM
Nik Offline
Registered User
 
Join Date: Mar 2004
Location: Thessaloniki
Age: 37
Posts: 11
i use firefox and i have set encoding to greek .although i can see other greek pages i cant seem to be bale to see mine!

i originally made this website with perl in windows and copy it to linux!

is there a problem with that?
__________________
The Devil Is In The Details!
Reply With Quote
  #6  
Old 26th March 2004, 04:16 AM
Jman Offline
Registered User
 
Join Date: Mar 2004
Location: Minnesota, USA
Age: 28
Posts: 7,909
It should not matter that you coded it on Windows.

Something interesting: trying to validate your script gives a character encoding mismatch.
Quote:
The character encoding specified in the HTTP header (iso-8859-7) is different from the value in the XML declaration (iso-8859-1).
Try changing the encoding in the XML outputted by the script to iso-8859-7.
Reply With Quote
  #7  
Old 26th March 2004, 01:37 PM
Nik Offline
Registered User
 
Join Date: Mar 2004
Location: Thessaloniki
Age: 37
Posts: 11
thanks but how can i do that?

and what exactly is validation?
__________________
The Devil Is In The Details!
Reply With Quote
  #8  
Old 26th March 2004, 05:24 PM
Jman Offline
Registered User
 
Join Date: Mar 2004
Location: Minnesota, USA
Age: 28
Posts: 7,909
A valid HTML or XML document follows all the standards. It has all correct tags, closes them correctly, and basicly is well formed.

Your perl script, however, returned iso-8859-1 encoding when the xml document the script writes is encoded in iso-8859-7. That is your script, right? If so, all you have to do is to get the origional script (the perl code), open it in a text editor like gedit, search for iso-8859-1 and replace it with iso-8859-7.

Maybe you can post or attach some of the code? The relevant part should be at the beginning of the script.
Reply With Quote
  #9  
Old 26th March 2004, 05:48 PM
Nik Offline
Registered User
 
Join Date: Mar 2004
Location: Thessaloniki
Age: 37
Posts: 11
here is all of my index.pl. except the header part it has nowhere else iso. ii ties to remove the iso part part butn then i can see no greek so i must have it:

here is the code:

PHP Code:
#!/usr/bin/perl -w
use CGI::Carp qw(fatalsToBrowser);
use 
CGI qw(:standard);
use 
DBI;
use 
DBD::mysql;
use 
Mail::Sendmail;

$xronos scalar(localtime(time 7200));
$xronos =~ s/:\d{2} \d{4}//g;

$ip $ENV{'REMOTE_ADDR'};
@
numbers split (/\./,$ip);
$address pack ("C4", @numbers);
$host gethostbyaddr ($address2) || $ip;

print 
header( -charset=>'iso-8859-7' );
print 
start_html( -title=>'Ψυχωφελή Πνευματικά Κείμενα!', -background=>'../data/images/night.jpg' );

$db = ($ENV{'SERVER_NAME'ne 'nikos.50free.net')
    ? 
DBI->connect('DBI:mysql:nikos_db''root''')
    : 
DBI->connect('DBI:mysql:nikos_db:50free.net''nikos_db''macgyver')
    or print 
font({-size=>5, -color=>'Lime'}, $DBI::errstr) and exit 0;

@
files = <../data/texts/*.txt>;
$file  = $files[int(rand(@files))];

open(IN, "<$file") or die $!;
   @data = <IN>;
close(IN);

$data = join("", @data);
$data =~ s/\n/\\n/g;


#*******************************************************************************
print <<ENDOFHTML;
<html><head><title></title>
<script type="text/javascript">

var textToShow = "$data";
var tm;
var pos = 0;
var counter = 0;

function init()
{ tm = setInterval("type()", 50) }

function type()
{
   if (textToShow.length != pos)
   {
      d = document.getElementById("DivText");
      c = textToShow.charAt(pos++);

      if (c.charCodeAt(0) != 10)
         d.appendChild(document.createTextNode(c));
      else
         d.appendChild(document.createElement("br"));

      counter++;

      if (counter >= 1800 && (c.charCodeAt(0) == 10 || c == "."))
      {
         d.appendChild(document.createElement("br"));
         d.appendChild(document.createTextNode("Press any key..."));
         counter = 0;
         clearInterval(tm);
         document.body.onkeypress = function () { document.getElementById("DivText").innerHTML = ''; tm = setInterval("type()", 50); document.body.onkeypress = null; };
      }
   }
   else
      clearInterval(tm);
}
</script>

<center><font size=5 color=Lime>- Λόγος Ψυχωφελής και Θαυμάσιος -<br><br>
<body onload=init()>
  <center>
  <div id="DivText" align="Left" style="
    background: url(../data/images/blueblack.jpg);
    border-color: Yellow;
    border-style: Groove;
    border-width: 10;
    width: 900;
    height: 500;
    color: Lightblue;
    font-face: Com;
    font-size: 19">
  </div>
</body>
</html>
ENDOFHTML
#*******************************************************************************


print br(), br();
print start_form(-action=>"show.pl");
print table( {border=>1, -width=>"55%", -align=>"center", -style=>"border: ridge lime; color: yellow; font-size: 20", -background=>"../data/images/wood.jpg"},
      Tr( {-align=>'center'}, td( "Πώς λέγεσαι?" ),                              td( textfield( 'onoma' ))),
      Tr( {-align=>'center'}, td( "Ποιό είναι το σχόλιο σου επί του θέματος?" ), td( textarea( -name=>'sxolio', -rows=>6, -columns=>30 ) ) ),
      Tr( {-align=>'center'}, td( "Ποιό είναι το e-mail σου?" ),                 td( textfield( 'email' ))),
      Tr( {-align=>'center'}, td( submit( 'Εμφάνιση' )),                         td( submit( 'Αποστολή' ))));
print end_form(), br(), br();

open(IN, "<../data/texts/tips.txt") or die $!;
   @tips = <IN>;
close(IN);

@tips = grep { !/^\s*\z/s } @tips;
$tip = $tips[int(rand(@tips))];

print table( {-width=>"90%", -align=>"center", -style=>"border: ridge magenta", -background=>"../data/images/fire.jpg"},
      Tr( td( {-align=>'center'}, font( {-size=>3, -color=>'lime'}, b( $tip )))));

$db->do( "UPDATE counter SET visitor = visitor + 1" );

$st = $db->prepare( "SELECT visitor FROM counter" );
$st->execute();
$row = $st->fetchrow_hashref;

print font( {-size=>4, -color=>'Yellow'}, "<br>$host<br>" );
print font( {-size=>4, -color=>'Orange'}, "<br>$xronos<br>" );
print font( {-size=>4, -color=>'Cyan'},   "<br>$row->{visitor}<br><br>" );

print                       a( {href=>'games.pl'},        img {src=>'../data/images/games.gif'} );
print p( {-align=>'right'}, a( {href=>'../data/photos/'}, font( {-size=>4, -color=>'Lime'}, 'Π' )));

if ($host =~ /thes530-.*?\.otenet\.gr|millennium-.*?\.ccf\.auth\.gr/) { exit 0; }

open(OUT, ">>../data/texts/log.txt") or die $!;
   print OUT $host, " "x(40-length($host)), "->     ", $xronos, "\n";
close(OUT);

if ($ENV{'SERVER_NAME'} ne 'nikos.50free.net') { exit 0; }
%mail = ( To      => 'nik0s@mycosmos.gr',
          From    => '007@kyp.gr',
          Subject => "Επισκέπτης από $host"
        );
sendmail(%mail) or die $Mail::Sendmail::error; 
i still i am no ble to understand whats wrong....
__________________
The Devil Is In The Details!
Reply With Quote
  #10  
Old 26th March 2004, 05:50 PM
Nik Offline
Registered User
 
Join Date: Mar 2004
Location: Thessaloniki
Age: 37
Posts: 11
it has no reference on iso-8859-1 so i dont understand why igt gives you such a result...
__________________
The Devil Is In The Details!
Reply With Quote
  #11  
Old 26th March 2004, 06:24 PM
Jman Offline
Registered User
 
Join Date: Mar 2004
Location: Minnesota, USA
Age: 28
Posts: 7,909
The problem isn't this perl script. It might be in show.pl. It might be in the text file it is displaying.

I don't know what else to do but look for that pesky iso-8859-1.

I see the web server is Apache 2. It could be the web server, but I don't think so.
Reply With Quote
  #12  
Old 26th March 2004, 07:04 PM
Nik Offline
Registered User
 
Join Date: Mar 2004
Location: Thessaloniki
Age: 37
Posts: 11
the web server is ok

also i have nowhere set iso-8859-1

only 7 for greek.

i have double checked it!!
__________________
The Devil Is In The Details!
Reply With Quote
  #13  
Old 28th March 2004, 06:23 PM
Jman Offline
Registered User
 
Join Date: Mar 2004
Location: Minnesota, USA
Age: 28
Posts: 7,909
I see another possible problem: viewing the source of the text frame I see this:
PHP Code:
<html xmlns="http://www.w3.org/1999/xhtml" lang="[b]en-US[/b]" xml:lang="[b]en-US[/b]"
I don't think you want US English.

Somewhere in your perl and javascript there are en-US tags.
Reply With Quote
  #14  
Old 28th March 2004, 11:43 PM
Nik Offline
Registered User
 
Join Date: Mar 2004
Location: Thessaloniki
Age: 37
Posts: 11
Well here is my javascript part! i dont see anywhere here something about encoding neither in perl code as well!

Do you?


#************************************************* ******************************
print <<ENDOFHTML;
<html><head><title></title>
<script type="text/javascript">

var textToShow = "$data";
var tm;
var pos = 0;
var counter = 0;

function init()
{ tm = setInterval("type()", 50) }

function type()
{
if (textToShow.length != pos)
{
d = document.getElementById("DivText");
c = textToShow.charAt(pos++);

if (c.charCodeAt(0) != 10)
d.appendChild(document.createTextNode(c));
else
d.appendChild(document.createElement("br"));

counter++;

if (counter >= 1800 && (c.charCodeAt(0) == 10 || c == "."))
{
d.appendChild(document.createElement("br"));
d.appendChild(document.createTextNode("Press any key..."));
counter = 0;
clearInterval(tm);
document.body.onkeypress = function () { document.getElementById("DivText").innerHTML = ''; tm = setInterval("type()", 50); document.body.onkeypress = null; };
}
}
else
clearInterval(tm);
}
</script>

<center><font size=5 color=Lime>- Ëüãïò Øõ÷ùöåëÞò êáé ÈáõìÜóéïò -<br><br>
<body onload=init()>
<center>
<div id="DivText" align="Left" style="
background: url(../data/images/blueblack.jpg);
border-color: Yellow;
border-style: Groove;
border-width: 10;
width: 900;
height: 500;
color: Lightblue;
font-face: Com;
font-size: 19">
</div>
</body>
</html>
ENDOFHTML
#************************************************* ******************************

what is the xml anyway? a successor of html?
__________________
The Devil Is In The Details!
Reply With Quote
  #15  
Old 29th March 2004, 06:19 AM
Jman Offline
Registered User
 
Join Date: Mar 2004
Location: Minnesota, USA
Age: 28
Posts: 7,909
XML is basically a flexible way to store text data with tags, much like HTML. In some ways you can consider it the sucessor of HTML.

I don't see any encoding there either.

I'm sorry I can't find the wrong language headers. They might even be buried in your mysql database.

However, I can see virtually every character, even if Mozilla thinks the page is in US English. Can you? Is it worth the effort?
Reply With Quote
Reply

Tags
browsers, fedora, font, problem

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
XMMS on Fedora 10 (Font problem) samsainju Using Fedora 12 13th March 2009 03:22 AM
Font problem in Xfig on Fedora 7 QuantumKnot Using Fedora 4 17th September 2008 04:54 PM
Printing from Browsers; Crash Browsers!!! cmh8133 Using Fedora 4 4th November 2006 07:46 PM
Font Spacing in gecko browsers, FC3 DGF Using Fedora 0 28th May 2005 09:22 PM


Current GMT-time: 05:57 (Sunday, 23-11-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat
Ishim Photos on Instagram - Khorramabad Photos on Instagram - Kotido Instagram Photos