cx717 Posted October 10, 2007 Report Share Posted October 10, 2007 С помощью javascript'а разместил флеку на html страничке.В мета-теге пишу: <META HTTP-EQUIV="Content-Type" content="text/html; charset=utf-8"/>Но браузер остается в кодировке windows-1251. В результате русский текст становится абра-кадаброй.Вот пример:www.g17.h18.ruПомогите плз - вторые сутки мучаюсь.iobject.js: function showFlash(o){ var bg,q,s,v; if(o.bgcolor){bg=o.bgcolor;}else{bg="#FFFFFF";} if(o.quality){q=o.quality;}else{q="high";} if(o.scale){s=o.scale;}else{s="noscale";} if(o.ver){v=o.ver;}else{v=6;} var str='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+v+',0,0,0" '; str+='id="'+o.id+'" '; if(o.base){str+='base="'+o.base+'" ';} if(o.align){str+='align="'+o.align+'" ';} str+='width="'+o.width+'" height="'+o.height+'"><param name="movie" value="'+o.name+'"/><param name="bgcolor" value="'+bg+'"/><param name="quality" value="'+q+'"/>'; if(o.flashvars){str+='<param name="flashvars" value="'+o.flashvars+'"/>';} if(o.allowScriptAccess){str+='<param name="allowScriptAccess" value="'+o.allowScriptAccess+'"/>';} if(o.salign){str+='<param name="salign" value="'+o.salign+'"/>';} if(o.wmode){str+='<param name="wmode" value="'+o.wmode+'"/>';} str+='<param name="scale" value="'+s+'"/><embed type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" id="'+o.id+'-embed" src="'+o.name+'" bgcolor="'+bg+'" '; if(o.flashvars){str+='flashvars="'+o.flashvars+'" ';} if(o.swLiveConnect){str+='swLiveConnect="'+o.swLiveConnect+'" ';} if(o.allowScriptAccess){str+='allowScriptAccess="'+o.allowScriptAccess+'" ';} str+='quality="'+q+'" '; if(o.base){str+='base="'+o.base+'" ';} if(o.wmode){str+='base="'+o.wmode+'" ';} if(o.salign){str+='salign="'+o.salign+'" ';} str+='scale="'+s+'" width="'+o.width+'" height="'+o.height+'"></embed></object>'; document.writeln(str);} Quote Link to comment Share on other sites More sharing options...
0 Dimitry Wolotko Posted October 10, 2007 Report Share Posted October 10, 2007 в JS Quote Link to comment Share on other sites More sharing options...
0 yopopt Posted October 10, 2007 Report Share Posted October 10, 2007 С помощью javascript'а разместил флеку на html страничке.В мета-теге пишу: <META HTTP-EQUIV="Content-Type" content="text/html; charset=utf-8"/>Но браузер остается в кодировке windows-1251. В результате русский текст становится абра-кадаброй.Вот пример:www.g17.h18.ruПомогите плз - вторые сутки мучаюсь.Необходимо установить кодировку на сервере. Вам сюда: http://forum.htmlbook.ru/index.php?showtopic=5513 Читайте касательно .htaccess Quote Link to comment Share on other sites More sharing options...
0 cx717 Posted October 10, 2007 Author Report Share Posted October 10, 2007 Dimitry Wolotko, насколько я понимаю в js никакого упоминания о кодировке нет.Yopopt, на моем хостинге нет файла .htaccess (насколько мне известно он применяется в php технологиях, а у меня обыкновенный html) Quote Link to comment Share on other sites More sharing options...
0 yopopt Posted October 10, 2007 Report Share Posted October 10, 2007 Dimitry Wolotko, насколько я понимаю в js никакого упоминания о кодировке нет.Yopopt, на моем хостинге нет файла .htaccess (насколько мне известно он применяется в php технологиях, а у меня обыкновенный html)Ну до чего люди ленивые пошли!!! Я Вам ч?тко указал что нужно сделать, а Вы... Ладно здесь, но не попытаться узнать ответ из FAQ на хосте - это...Вот: http://www.holm.ru/faq/admin.shtmlЦитата:Пример переопределения исходной кодировки html документов. Предположим, что по каким-то причинам, все файлы в Вашей директории WWW представлены в кодировке koi8-r. В этом случае надо поместить в каталог WWW файл .htaccess, содержащий строчку: CharsetSourceEnc koi8-r. Quote Link to comment Share on other sites More sharing options...
0 Dimitry Wolotko Posted October 10, 2007 Report Share Posted October 10, 2007 Ох, по запарке увидел много js кода - отправил сюда, ну увы. Quote Link to comment Share on other sites More sharing options...
0 cx717 Posted October 10, 2007 Author Report Share Posted October 10, 2007 Спасибо большое, сейчас буду читать. Quote Link to comment Share on other sites More sharing options...
0 cx717 Posted October 10, 2007 Author Report Share Posted October 10, 2007 yopopt, можно вопрос? Как создать файл .htaccess ? У меня комп пишет, что должно быть название файла. Quote Link to comment Share on other sites More sharing options...
0 Dimitry Wolotko Posted October 10, 2007 Report Share Posted October 10, 2007 Нет. он должен быть .htaccess - имено у него нет, htaccess - это расширение. Quote Link to comment Share on other sites More sharing options...
0 cx717 Posted October 10, 2007 Author Report Share Posted October 10, 2007 Dimitry Wolotko, извините за такой вопрос, но как создать файл без имени? Quote Link to comment Share on other sites More sharing options...
0 cx717 Posted October 10, 2007 Author Report Share Posted October 10, 2007 Понял Quote Link to comment Share on other sites More sharing options...
0 LokiDi L0ck Posted October 10, 2007 Report Share Posted October 10, 2007 на моем хостинге нет файла .htaccess (насколько мне известно он применяется в php технологиях, а у меня обыкновенный html)это круто... Quote Link to comment Share on other sites More sharing options...
0 cx717 Posted October 10, 2007 Author Report Share Posted October 10, 2007 yopopt,Извините за навязчивость, но хочется разобраться.CharsetSourceEnc отвечает за то в какой кодировке файлы будут храниться на сервере.Я поместил в файл .htaccess строку CharsetSourceEnc utf-8 и на сайт стало невозможно зайти.Подскажите плз, что надо написать в .htaccess, что бы браузер клиента автоматически переходил в utf-8 ? Quote Link to comment Share on other sites More sharing options...
0 LokiDi L0ck Posted October 10, 2007 Report Share Posted October 10, 2007 AddType "text/html; charset=utf-8" .html .htm .shtmlВырезано по ссылке привед?нной yopopt.cx717, вы видимо игнорируете помощь и не ходите по каким-то там непонятным ссылкам. Quote Link to comment Share on other sites More sharing options...
0 cx717 Posted October 10, 2007 Author Report Share Posted October 10, 2007 LokiDi LOck, я просто уже вторые сутки врешаю вопрос с которым проблем-то вроде быть недолжно(хотя это конечно не оправдание) Создал я файл .htaccess, в нем одна единственная строкаAddType "text/html; charset=utf-8" .html .htm .shtml.htaccess сохранил в utf-8.Заслал на сервак в папку www. В результате браузер в течении секунды тупит и вываливается на страницу спама - это обычно происходит, когда ему не найти страницу.Пример: www.g17.h18.ruКстати, если сохранить html файл в ANSI кодировке, то на локалке шрифт преврашается в ромбики, зато на хосте - разборчив.Чето я запутолся, help me please. Quote Link to comment Share on other sites More sharing options...
0 yopopt Posted October 10, 2007 Report Share Posted October 10, 2007 Я получаю от сервера ошибку 500. Это говорит о том, что Вы что-то неправильно прописали в .htaccess.Подробнее про него прочитайте здесь: http://htaccess.net.ru/ или для начала здесь: http://argon.com.ru/internet/webmastering/htaccessВ Вашем случае думаю будет достаточно прописатьAddDefaultCharset utf-8Добавлено:Более конкретно: http://htaccess.net.ru/doc/AddType-charset...rsetDefault.php Quote Link to comment Share on other sites More sharing options...
0 Tokolist Posted October 10, 2007 Report Share Posted October 10, 2007 Нет. он должен быть .htaccess - имено у него нет, htaccess - это расширение.htaccess - это не расширениеточка в начале имени = скрытый файл в *никс Quote Link to comment Share on other sites More sharing options...
0 Dimitry Wolotko Posted October 10, 2007 Report Share Posted October 10, 2007 Я знаю - пытался объяснить популярнее. Quote Link to comment Share on other sites More sharing options...
0 Tokolist Posted October 10, 2007 Report Share Posted October 10, 2007 к сожалению, таким образом вводишь в заблуждения новичков потом будут думать что в *никс существует понятие "расширение" Quote Link to comment Share on other sites More sharing options...
0 Dimitry Wolotko Posted October 10, 2007 Report Share Posted October 10, 2007 Возможно ты и прав.Интересно, а они знают что такое *никсы?)) Quote Link to comment Share on other sites More sharing options...
0 cx717 Posted October 11, 2007 Author Report Share Posted October 11, 2007 Yopopt, спасибо за ссылки.Почитал, разобрался - у меня .htaccess был не в UNIX-формате. Теперь похоже проблема с компом.Просьба, если не лень, зайдите, плз, по ссылке www.daiquiri.spb.ru/xxx.htmlПоидее должна вылести надпись : апрашиваемый документ был перемещ?н или удал?н.У меня этого нет, а на хосте мне сказали, что у них эта надпись видна (использовать лучше IE или FF). Quote Link to comment Share on other sites More sharing options...
0 yopopt Posted October 11, 2007 Report Share Posted October 11, 2007 В ие не отображается, поскольку код страницы ошибки 404 слишком мал. Он считает е? неинформативной и потому показывает свою. Quote Link to comment Share on other sites More sharing options...
0 cx717 Posted October 11, 2007 Author Report Share Posted October 11, 2007 На хостинге мне сказали, что если 404.html<500 байт, то только для Oper'ы этого "мало" - у них в IE "404.html" отображается нормально. Я только-что увеличил "404.html" до 1KB - на моем компе ничего не изменилось.Посмотрите ещ? раз пожалуйста http://www.daiquiri.spb.ru/gdgkf.html Quote Link to comment Share on other sites More sharing options...
0 cx717 Posted October 11, 2007 Author Report Share Posted October 11, 2007 В IE все нормально, а в FF - нет.С чем это может быть связано, как вы думаете? Quote Link to comment Share on other sites More sharing options...
0 yopopt Posted October 11, 2007 Report Share Posted October 11, 2007 На хостинге мне сказали, что если 404.html Я только-что увеличил "404.html" до 1KB - на моем компе ничего не изменилось.Посмотрите ещ? раз пожалуйста http://www.daiquiri.spb.ru/gdgkf.htmlСмешные они. Проверил - теперь вс? работает в ие6, ие7, Опере 9 и Фаерфоксе 2.0.0.7. Quote Link to comment Share on other sites More sharing options...
0 Dimitry Wolotko Posted October 12, 2007 Report Share Posted October 12, 2007 не менее не 500 байт, а 511. Quote Link to comment Share on other sites More sharing options...
Question
cx717
С помощью javascript'а разместил флеку на html страничке.
В мета-теге пишу:
Но браузер остается в кодировке windows-1251. В результате русский текст становится абра-кадаброй.
Вот пример:www.g17.h18.ru
Помогите плз - вторые сутки мучаюсь.
iobject.js:
function showFlash(o){var bg,q,s,v;
if(o.bgcolor){bg=o.bgcolor;}else{bg="#FFFFFF";}
if(o.quality){q=o.quality;}else{q="high";}
if(o.scale){s=o.scale;}else{s="noscale";}
if(o.ver){v=o.ver;}else{v=6;}
var str='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+v+',0,0,0" ';
str+='id="'+o.id+'" ';
if(o.base){str+='base="'+o.base+'" ';}
if(o.align){str+='align="'+o.align+'" ';}
str+='width="'+o.width+'" height="'+o.height+'"><param name="movie" value="'+o.name+'"/><param name="bgcolor" value="'+bg+'"/><param name="quality" value="'+q+'"/>';
if(o.flashvars){str+='<param name="flashvars" value="'+o.flashvars+'"/>';}
if(o.allowScriptAccess){str+='<param name="allowScriptAccess" value="'+o.allowScriptAccess+'"/>';}
if(o.salign){str+='<param name="salign" value="'+o.salign+'"/>';}
if(o.wmode){str+='<param name="wmode" value="'+o.wmode+'"/>';}
str+='<param name="scale" value="'+s+'"/><embed type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" id="'+o.id+'-embed" src="'+o.name+'" bgcolor="'+bg+'" ';
if(o.flashvars){str+='flashvars="'+o.flashvars+'" ';}
if(o.swLiveConnect){str+='swLiveConnect="'+o.swLiveConnect+'" ';}
if(o.allowScriptAccess){str+='allowScriptAccess="'+o.allowScriptAccess+'" ';}
str+='quality="'+q+'" ';
if(o.base){str+='base="'+o.base+'" ';}
if(o.wmode){str+='base="'+o.wmode+'" ';}
if(o.salign){str+='salign="'+o.salign+'" ';}
str+='scale="'+s+'" width="'+o.width+'" height="'+o.height+'"></embed></object>';
document.writeln(str);
}
Link to comment
Share on other sites
25 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.