Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
utf8 i naša slova
Goto page 1, 2  Next
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Client-side
View previous topic :: View next topic  
Author Message
blackshtef
mi3.crew


Joined: 14 Sep 2003
Posts: 661

PostPosted: 02.09.2005 13:58    Post subject: utf8 i naša slova Add user to your forum ignore list Reply with quote

Ovak, recimo imam neki php file koji ima samo tekst u sebi. I sad, ako je charset postavljen na windows-1250, prikazivat će se naša slova, ali ako je postavljen na utf-8, ili iso-8859-2, ne radi. Tj, prikazuje sve osim ŠŽšž.
Jel ima kakva opcija da to proradi u UTF8, jer koliko sam čuo, XHTML Strict ne propušta naše znakove, osim ako nije utf?
Back to top
View user's profile Send private message Send e-mail MSN Messenger
maratz
mi3.crew


Joined: 24 Nov 2003
Posts: 1207
Location: ZAG

PostPosted: 02.09.2005 14:44    Post subject: Add user to your forum ignore list Reply with quote

konvertaj file u editoru u UTF-8 w/o BOM i piši normalno za utf-8 ili piši UTF entitije za iso-8859-2 charset, bez konverzije filea.

Al budi ziher da ti je site XHTML Strict in the first place. To kaj prolazi validator, ne znači da je Strict.

_________________
STOP HITTING YOURSELF! | NETIQUETTE | TYPETESTER | Hypertext rulez™ | CREATIVE NIGHTS | ACCOMMODATIONS
Back to top
View user's profile Send private message Visit poster's website Twitter profile
Gale



Joined: 04 Apr 2005
Posts: 120

PostPosted: 02.09.2005 15:00    Post subject: Add user to your forum ignore list Reply with quote

Ako misliš na lokalno pokretanje najvjerojatnije ti je default charset u php.ini -u postavljen da windows-1250, pa ne parsira kako spada ISO-8859-2
Back to top
View user's profile Send private message Visit poster's website
lekke



Joined: 17 Jun 2004
Posts: 860
Location: 25th floor

PostPosted: 02.09.2005 15:09    Post subject: Re: utf8 i naša slova Add user to your forum ignore list Reply with quote

blackshtef wrote:
Ovak, recimo imam neki php file koji ima samo tekst u sebi. I sad, ako je charset postavljen na windows-1250, prikazivat će se naša slova, ali ako je postavljen na utf-8, ili iso-8859-2, ne radi. Tj, prikazuje sve osim ŠŽšž.
Jel ima kakva opcija da to proradi u UTF8, jer koliko sam čuo, XHTML Strict ne propušta naše znakove, osim ako nije utf?


http://webdesign.maratz.com/lab/utf_table/

pa udri copy/paste Smile

_________________
You need more bass.
Back to top
View user's profile Send private message
blackshtef
mi3.crew


Joined: 14 Sep 2003
Posts: 661

PostPosted: 02.09.2005 21:02    Post subject: Add user to your forum ignore list Reply with quote

Gale wrote:
Ako misliš na lokalno pokretanje najvjerojatnije ti je default charset u php.ini -u postavljen da windows-1250, pa ne parsira kako spada ISO-8859-2

Nije, na utf-8 je postavljen...

lekke wrote:

http://webdesign.maratz.com/lab/utf_table/

pa udri copy/paste Smile

Ne da mi se copy/pasteat za svako Š i Ž i š i ž Smile
Al zanimljivo je to da dok tipkam sa tipkovnice, onda ne prepozna veliko i malo Š i Ž, ali dok unesem te kodove, onda radi kak treba Idea
ustvari, to je što maratz veli, pišem utf kodove bez konverzije...

budem najvjerovatnije kovertirao sve u utf8...

BTW. maratz, a kak mogu bit 100% siguran da je strict?
Back to top
View user's profile Send private message Send e-mail MSN Messenger
maratz
mi3.crew


Joined: 24 Nov 2003
Posts: 1207
Location: ZAG

PostPosted: 02.09.2005 22:39    Post subject: Add user to your forum ignore list Reply with quote

Najbolje da proučiš specke.

_________________
STOP HITTING YOURSELF! | NETIQUETTE | TYPETESTER | Hypertext rulez™ | CREATIVE NIGHTS | ACCOMMODATIONS
Back to top
View user's profile Send private message Visit poster's website Twitter profile
gog



Joined: 18 Jun 2004
Posts: 679
Location: zagreb

PostPosted: 03.09.2005 02:14    Post subject: Add user to your forum ignore list Reply with quote

Znas li neke stvari koje validator ne kuzi?
Back to top
View user's profile Send private message Visit poster's website
maratz
mi3.crew


Joined: 24 Nov 2003
Posts: 1207
Location: ZAG

PostPosted: 03.09.2005 08:42    Post subject: Add user to your forum ignore list Reply with quote

Ne kuži kontekst. Ako baš hoćeš biti Strict, serviraj doc kao application/xhtml+xml za browsere koji to podržavaju, što podrazumjeva besprijekornu strukturu.

_________________
STOP HITTING YOURSELF! | NETIQUETTE | TYPETESTER | Hypertext rulez™ | CREATIVE NIGHTS | ACCOMMODATIONS
Back to top
View user's profile Send private message Visit poster's website Twitter profile
gog



Joined: 18 Jun 2004
Posts: 679
Location: zagreb

PostPosted: 03.09.2005 11:54    Post subject: Add user to your forum ignore list Reply with quote

Pa ne znam bas sto bih time dobio osim sporijeg prikaza? AFAIK ako ga serviras kao application/xhtml+xml browser mora dohvatiti citavu stranicu da bi ju mogao renderirati...
Back to top
View user's profile Send private message Visit poster's website
maratz
mi3.crew


Joined: 24 Nov 2003
Posts: 1207
Location: ZAG

PostPosted: 03.09.2005 12:10    Post subject: Add user to your forum ignore list Reply with quote

gog wrote:
Pa ne znam bas sto bih time dobio osim sporijeg prikaza? AFAIK ako ga serviras kao application/xhtml+xml browser mora dohvatiti citavu stranicu da bi ju mogao renderirati...
Neam fakat pojma

_________________
STOP HITTING YOURSELF! | NETIQUETTE | TYPETESTER | Hypertext rulez™ | CREATIVE NIGHTS | ACCOMMODATIONS
Back to top
View user's profile Send private message Visit poster's website Twitter profile
gog



Joined: 18 Jun 2004
Posts: 679
Location: zagreb

PostPosted: 03.09.2005 13:11    Post subject: Add user to your forum ignore list Reply with quote

Evo poigrao sam se malo, ukoliko otvorite s firefoxom www.info-mob.com/clanak.php i bilo koji od clanaka sadrzaj ce vam biti serviran kao application/xhtml+xml, morao sam samo u css-u postaviti podazinsku boju na html, posto body i html bas i nije isto ako tako serviras dokument, ugl. imao sam white spejsa, na dnu stranice koja ne pokrivao citav ekran.

Drugi problem mi je google adsense javascript, no i za to postoji workaround -> http://keystonewebsites.com/articles/adsense.php No s tim mi se trenutno ne da zafrkavati, pa nema reklama Smile

c&p sa http://www.hixie.ch/advocacy/xhtml

* The only real advantage to using XHTML rather than HTML4 is that it
is then possible to use XML tools with it. However, if tools are
being used, then the same tools might as well produce HTML4 for you.
Alternatively, the tools could take SGML as input instead of XML.
(SGML is over a decade older than XML and the tools have existed
for years.)
Back to top
View user's profile Send private message Visit poster's website
Sulien



Joined: 04 Jan 2004
Posts: 2905
Location: Zagreb

PostPosted: 03.09.2005 14:11    Post subject: Add user to your forum ignore list Reply with quote

maratz wrote:
gog wrote:
Pa ne znam bas sto bih time dobio osim sporijeg prikaza? AFAIK ako ga serviras kao application/xhtml+xml browser mora dohvatiti citavu stranicu da bi ju mogao renderirati...

Neam fakat pojma

dobiješ stranicu koja nema grešaka (barem ne well-formedness grešaka) jer kad bi ih bilo, ne bi ti se prikazala... to je dosta dobra motivacija da zatvoriš dobro svoje tagove!

drugo, slanje XHTML-a kao XML je čvrst dokaz da je taj dokument stvarno XML i da se na njega mogu primijeniti XML alati (kao recimo XSLT) što će ti se dugoročno jako isplatiti

treće, prisiljen si koristiti DOM umjesto nekakvih HTML Javascript rješenja što će ti se opet dugoročno isplatiti Smile

Code:
/** Check if browser accepts XHTML
 * @author Chris Pederick
 * @return bool true if the browser accepts application/xhtml+xml; false if it prefers text/html
 */
function XHTML(){
   $XHTML = false;
   // If the user agent accepts XHTML
   if(stristr($_SERVER['HTTP_ACCEPT'], 'application/xhtml+xml')){
      $XHTML = true;
      // If the user agent specifies a q value for XHTML
      if(preg_match('%application/xhtml\+xml;q=0(\.[1-9]+)%i', $_SERVER['HTTP_ACCEPT'], $matches)){
         $qXHTML = $matches[1];
         // If the user agent specifies a q value for HTML
         if(preg_match('%text/html;q=0(\.[1-9]+)%i', $_SERVER['HTTP_ACCEPT'], $matches)){
            $qHTML = $matches[1];
            // If the q value for HTML is greater than the q value for XHTML
            if($qHTML > $qXHTML) $XHTML = false;
            }
         }
      }
   return $XHTML;
   }
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Sulien



Joined: 04 Jan 2004
Posts: 2905
Location: Zagreb

PostPosted: 03.09.2005 14:19    Post subject: Add user to your forum ignore list Reply with quote

gog wrote:
Evo poigrao sam se malo, ukoliko otvorite s firefoxom www.info-mob.com/clanak.php i bilo koji od clanaka sadrzaj ce vam biti serviran kao application/xhtml+xml...

jedan od rijetkih sajtova za koji HTML validator firefox plugin pokazuje lijepu zelenu ikonu Smile najs
Back to top
View user's profile Send private message Send e-mail Visit poster's website
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 03.09.2005 15:50    Post subject: Add user to your forum ignore list Reply with quote

Sulien wrote:
jedan od rijetkih sajtova za koji HTML validator firefox plugin pokazuje lijepu zelenu ikonu Smile najs

i za moju, i za moju @_@

btw cekajte ako serviram XHTML kao text/html to u biti nije strict? ili je?

_________________
art & design portfoliofree Photoshop brushes stuffsketchblogfacebook
Back to top
View user's profile Send private message Visit poster's website Twitter profile
silence



Joined: 24 Apr 2004
Posts: 890
Location: .....ni na nebu, ni na zemlji.....

PostPosted: 03.09.2005 19:47    Post subject: Add user to your forum ignore list Reply with quote

http://www.emeditor.com/

mislim da snjim možeš radit koneversiju UTF-8 stranice u windows-1250.....
samo odrediš koaj ti treba i spremi.... nemoj me držat za riječ, nisam to radio već neko vrijeme.

_________________
This End-User License is an agreement between Microsoft Corporation (hereafter referred to as "Microsoft") and you, the end-user (hereafter referred to as "our bitch").
Back to top
View user's profile Send private message Visit poster's website
maratz
mi3.crew


Joined: 24 Nov 2003
Posts: 1207
Location: ZAG

PostPosted: 03.09.2005 21:06    Post subject: Add user to your forum ignore list Reply with quote

@Sulien: LOL!!1 čemu se zamarat objašnjavajući, kad znam da tebe to više veseli Smile

_________________
STOP HITTING YOURSELF! | NETIQUETTE | TYPETESTER | Hypertext rulez™ | CREATIVE NIGHTS | ACCOMMODATIONS
Back to top
View user's profile Send private message Visit poster's website Twitter profile
gog



Joined: 18 Jun 2004
Posts: 679
Location: zagreb

PostPosted: 04.09.2005 11:40    Post subject: Add user to your forum ignore list Reply with quote

Sulien wrote:

Code:
/** Check if browser accepts XHTML
 * @author Chris Pederick
...


Ja sam ovo iskoristio:

Code:
<?php
if ( stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml") ) {
  header("Content-type: application/xhtml+xml");
}
else {
  header("Content-type: text/html");
}
?>
Back to top
View user's profile Send private message Visit poster's website
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 16.09.2005 01:54    Post subject: Add user to your forum ignore list Reply with quote

yo, a mogu ja u istoj toj funkciji header odredit i utf-8 ili moram posebno zvat header?
recimo ako zelim provjerit dal browser prihvaca application, ali u oba slucaja je encoding utf-8 - primjer please?

_________________
art & design portfoliofree Photoshop brushes stuffsketchblogfacebook
Back to top
View user's profile Send private message Visit poster's website Twitter profile
gog



Joined: 18 Jun 2004
Posts: 679
Location: zagreb

PostPosted: 16.09.2005 05:02    Post subject: Add user to your forum ignore list Reply with quote

Po defaultu je utf-8, ali ako baš želiš:

Code:
header("Content-Type: text/html;charset=utf-8");
if ( stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml") ) {
  header("Content-type: application/xhtml+xml");
}
else {
  header("Content-type: text/html");
}


Nema smisla to ubacivati u if petlju jer u obadva slučaja serviraš utf-8...
Back to top
View user's profile Send private message Visit poster's website
maratz
mi3.crew


Joined: 24 Nov 2003
Posts: 1207
Location: ZAG

PostPosted: 16.09.2005 08:27    Post subject: Add user to your forum ignore list Reply with quote

Zapravo bi ispravno bilo, a i malo manje koda:
Code:
header('Content-type: ' . stristr($_SERVER['HTTP_ACCEPT'], 'application/xhtml+xml') ? 'application/xhtml+xml' : 'text/html' . '; charset=UTF-8'); // (sve u istoj liniji)
Resendanje headera je nepotrebno.

_________________
STOP HITTING YOURSELF! | NETIQUETTE | TYPETESTER | Hypertext rulez™ | CREATIVE NIGHTS | ACCOMMODATIONS
Back to top
View user's profile Send private message Visit poster's website Twitter profile
gog



Joined: 18 Jun 2004
Posts: 679
Location: zagreb

PostPosted: 16.09.2005 09:53    Post subject: Add user to your forum ignore list Reply with quote

BTW, kad smo već aktivirali topic, www.info-mob.com/clanak.php od sada prikazuje oglase i onima kojima se servira kao application/xhtml+xml i to poprilično "uredno"

Code:
<object data="/google.php" type="text/html" style="width:468px; height:60px;overflow:hidden;"></object>


a u google.ph, ovako nešto...

Code:

<?php header("Content-Type: text/html;charset=utf-8"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="hr">
  <head>
    <title>Google Adsense</title>
    <style type="text/css">
      html,body { margin: 0; padding: 0; }
      img {border:0;}
    </style>
  </head>
  <body>
    <script type="text/javascript">
      google_ad_client = "pub-xxxxxxx";
      google_alternate_ad_url = "http://www.info-mob.com/reklame/adframe.php?n=aa3bc09d&what=zone:3&target=_new";
      google_ad_width = 468;
      google_ad_height = 60;
      google_ad_format = "468x60_as";
      google_ad_type = "text_image";
      google_ad_channel ="";
      google_color_border = "556677";
      google_color_bg = "FFFFFF";
      google_color_link = "3366FF";
      google_color_url = "008000";
      google_color_text = "000000";
    </script>
    <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
    <noscript><a href='http://www.info-mob.com/reklame/adclick.php?n=aa3bc09d'><img src='http://www.info-mob.com/reklame/adview.php?what=zone:3&amp;n=aa3bc09d' width="468" height="60" alt='Reklama'></a></noscript>
  </body>
</html>
Back to top
View user's profile Send private message Visit poster's website
maratz
mi3.crew


Joined: 24 Nov 2003
Posts: 1207
Location: ZAG

PostPosted: 16.09.2005 10:10    Post subject: Add user to your forum ignore list Reply with quote

gg!

_________________
STOP HITTING YOURSELF! | NETIQUETTE | TYPETESTER | Hypertext rulez™ | CREATIVE NIGHTS | ACCOMMODATIONS
Back to top
View user's profile Send private message Visit poster's website Twitter profile
blackshtef
mi3.crew


Joined: 14 Sep 2003
Posts: 661

PostPosted: 16.09.2005 11:19    Post subject: Add user to your forum ignore list Reply with quote

maratz wrote:
Zapravo bi ispravno bilo, a i malo manje koda:
Code:
header('Content-type: ' . stristr($_SERVER['HTTP_ACCEPT'], 'application/xhtml+xml') ? 'application/xhtml+xml' : 'text/html' . '; charset=UTF-8'); // (sve u istoj liniji)
Resendanje headera je nepotrebno.


A kak se to i kuda meće Embarassed
Back to top
View user's profile Send private message Send e-mail MSN Messenger
gog



Joined: 18 Jun 2004
Posts: 679
Location: zagreb

PostPosted: 16.09.2005 11:22    Post subject: Add user to your forum ignore list Reply with quote

Pa u php fajlu, na početak...
Back to top
View user's profile Send private message Visit poster's website
blackshtef
mi3.crew


Joined: 14 Sep 2003
Posts: 661

PostPosted: 16.09.2005 12:26    Post subject: Add user to your forum ignore list Reply with quote

ovako?
Code:
<?php header('Content-type: ' . stristr($_SERVER['HTTP_ACCEPT'], 'application/xhtml+xml') ? 'application/xhtml+xml' : 'text/html' . '; charset=UTF-8');?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
itd.


Jel idu one dvije // na kraju?
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Client-side All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group