Closed Bug 177840 Opened 22 years ago Closed 20 years ago

Content-disposition can't display 2-byte(korean) character.

Categories

(Core :: Networking: HTTP, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: sosteam, Assigned: darin.moz)

References

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2a) Gecko/20020910
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2a) Gecko/20020910

Content-disposition can't display 2-byte(korean) character.

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Yunjung: can you please provide a sample URL that is broken?  thanks!
This is probably just bug 162765 
Depends on: 162765
This is that ASP source.
IE6 can display korean title filename.

<%@ LANGUAGE="VBSCRIPT" %>
<%Response.ContentType = "file/unknown"%>

<%
Dim Key
	Key=request("Key")

Dim content,title
		
Dim rs,con
set rs=server.createobject("adodb.recordset")
set con=server.createobject("adodb.connection")
	con.open strconn
	
	strSQL="select content,title from Fund_agreement where a.mail='" & Key &"'"

	rs.open strSQL,con

	content=rs("content")
	
	rs.close

	response.AddHeader "Content-disposition","attachment; filename="&title&".html"
%>

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ks_c_5601-1987">
<title><%=title%></title>
</head>
<body>
<span id="potcontent" style="line-height:160%;"><%=content%></span>
</body>
</html>
What headers does that actually end up sending?  Is the filename properly
encoded in the header?
filename = "Å×½ºÆ®" (<== korean)
urlencode -> not available.
euc-kr -> not available.
um... those do not look like HTTP headers. What http headers actually go out on
the wire?  (note that the use of non-ascii chars is explicitly prohibited by the
rfc and so this is basically invalid unless php is helpfully properly escaping
them for you).
This can be fixed as soon as I figure out a clean(well...?) way to fix bug 162765.
Hmm... actually ONLY IF one of the following conditions are met:

  - the server properly encodes the content of 'filename parameter' in EUC-KR
(please,
    fix your code. You should use 'EUC-KR' in place of 'ks_c_5601-1987'.
     or why don't you use just UTF-8 instead?) per RFC 2231. What you're doing is
     not compliant to RFC 2231 as Boris pointed out unless VBscript does
     some magic in a way unknown to me and encodes 'title.html' per RFC 2231. 

  - if you can't properly encode 'filename parameter' per RFC 2231, at least
     you should specify MIME charset in **http header** as well as (in meta tag)
    
      Content-Type: text/html; charset=EUC-KR 

  - if I add a third fallback (guess MIME charset from the current locale
     of a client) to my patch for bug 162765 to determine 
    the encoding of raw 8bit chars and the locale of your **client**
    happens to be using EUC-KR. 

As you can see, the best way is to fix your server application code to make it
compliant to **RFC 2231** and wait for my patch to bug 162765 to get landed.
(http://www.faqs.org/rfcs/rfc2231). RFC 2231 encoding is rather easy to implement
properly (a lot easier than RFC 2047 encoding that appears easy on the surface,
but not so in details).
 
  
Jungshik,
bug 162765 is closed.
Any luck with this bug?
I'm marking this invalid, actually -- no url, no steps to reproduce, no answers
to the question about what's actually going out over the wire.

Please reopen if this is still a problem in current builds; if you do so, please
provide the information needed to address the issue.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.