update manager and character set - Ext JS

本文讨论了在使用Ext.ContentPanel组件更新网页内容时遇到的土耳其字符显示问题。通过设置服务器响应头Content-Type来指定正确的字符集,或者在客户端使用overrideMimeType方法指定了iso-8859-9字符集,最终解决了字符显示乱码的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

hi,
i couldn't get turkish character set from update manager's response text. i'm using iso-8859-9 charset.
i'm updating with this code:
var newtab= new Ext.ContentPanel('content',{title: 'Genel', fitToFrame:true, closable:false});
var updater = newtab.getUpdateManager();
updater.loadScripts = true;
updater.setDefaultUrl('taslak.html');
updater.refresh();
Response Headers
Server Microsoft-IIS/5.1
X-Powered-By ASP.NET
Date Mon, 26 Feb 2007 19:12:54 GMT
Content-Type text/html
Accept-Ranges bytes
Last-Modified Mon, 26 Feb 2007 16:30:33 GMT
Etag "b0c2a70c359c71:a4a"
Content-Length 352

Request Headers
Host localhost
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; tr; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1
Accept application/x-shockwave-flash,text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language tr-TR,tr;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-9,utf-8;q=0.7,*;q=0.7
Keep-Alive 300
Connection keep-alive
Referer http://localhost/taslak/index.html
Cookie dbx-postmeta=grabit=0-,1-,2-,3-,4-,5-,6-&advancedstuff=0-,1-,2-; phpbb2mysql_data=a%3A2%3A%7Bs%3A11%3A%22autologinid%22%3Bs%3A0%3A%22%22%3Bs%3A6%3A%22userid%22%3Bi%3A-1%3B%7D
If-Modified-Since Mon, 26 Feb 2007 16:30:33 GMT
If-None-Match "b0c2a70c359c71:a4a"
Cache-Control max-age=0
Reply With Quote
  #2  
Old 02-27-2007, 01:45 AM
Default

i'm still waiting for a response... can anybody show me what am i missing pls
Reply With Quote
  #3  
Old 02-27-2007, 02:40 AM
Default

This is a server-side issue.

It's up to you to ensure that, on the server side, you encode the character data into bytes using a certain encoding, and then inform the browser that that was the encoding used in the "Content-Type" header:

Content-Type text/html;charset=<whatever character encoding you used>
Reply With Quote
  #4  
Old 02-27-2007, 02:53 AM
Default

hi animal,
i'm requesting a page with no headers like this tab.html
<div id ="container" style="padding:2px">
Genel Başlık</div>
i tried to change response header of update manager and finally do this and it worked ok. but do you have any idea how to make this solution out of yui core...i've added overridemimetype before send
connection.js line 331 (in package alpha 2 rev 5)
o.conn.overrideMimeType('text/html; charset=iso-8859-9');
o.conn.send(postData || null);
Reply With Quote
  #5  
Old 02-27-2007, 03:04 AM
Default

hi again
i found a solution with the code below:
updater.setDefaultUrl('taslak.html');
updater.refresh();
updater.transaction.conn.overrideMimeType('text/html; charset=iso-8859-9');
Reply With Quote
  #6  
Old 02-27-2007, 03:32 AM
Default

That's fine if your server will always use iso-8859-9

Use the Content-Type header for the purpose for which it was designed! Set the charset element to the encoding scheme that the server is using.

Again: this is a server-side issue that you must take care of in your ASP script
Reply With Quote
  #7  
Old 02-27-2007, 08:50 AM
Default

thanx for your reply animal. can u pls give me a simple example asp script for sending content containing turkish characters.
like this
<%
response.write "şığü??"
%>
Reply With Quote
  #8  
Old 02-27-2007, 08:59 AM
Default

ok i found it finally..i was missing a simple line
Response.CharSet="windows-1254"
Reply With Quote
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值