Improved Unicode support.

This commit is contained in:
2013-06-28 11:32:12 +02:00
parent 8040dd5826
commit dc25723a35
4 changed files with 13 additions and 9 deletions

View File

@@ -69,7 +69,7 @@ feature -- Access
-- Upload data
--| Note: make sure to precise the Content-Type header
upload_filename: detachable READABLE_STRING_8
upload_filename: detachable IMMUTABLE_STRING_32
-- Upload data read from `upload_filename'
--| Note: make sure to precise the Content-Type header
@@ -154,11 +154,15 @@ feature -- Element change
upload_data := a_data
end
set_upload_filename (a_fn: like upload_filename)
set_upload_filename (a_fn: detachable READABLE_STRING_GENERAL)
require
has_no_upload_filename: a_fn /= Void implies not has_upload_filename
do
upload_filename := a_fn
if a_fn = Void then
upload_filename := Void
else
create upload_filename.make_from_string_general (a_fn)
end
end
set_write_agent (agt: like write_agent)

View File

@@ -61,7 +61,7 @@ feature -- Execution
retried: BOOLEAN
l_form_data: detachable HASH_TABLE [READABLE_STRING_32, READABLE_STRING_32]
l_upload_data: detachable READABLE_STRING_8
l_upload_filename: detachable READABLE_STRING_8
l_upload_filename: detachable READABLE_STRING_GENERAL
l_headers: like headers
do
if not retried then
@@ -172,7 +172,7 @@ feature -- Execution
or request_method.is_case_insensitive_equal ("PUT")
end
create l_upload_file.make (l_upload_filename)
create l_upload_file.make_with_name (l_upload_filename)
if l_upload_file.exists and then l_upload_file.is_readable then
curl_easy.setopt_integer (curl_handle, {CURL_OPT_CONSTANTS}.curlopt_upload, 1)
@@ -388,7 +388,7 @@ feature {NONE} -- Implementation
end
note
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software

View File

@@ -85,7 +85,7 @@ feature -- Basic operation
f.close
check ctx /= Void then
ctx.set_upload_data (Void)
ctx.set_upload_filename (f.name)
ctx.set_upload_filename (f.path.name)
end
end
Result := custom ("PUT", a_path, ctx)
@@ -151,7 +151,7 @@ feature {LIBCURL_HTTP_CLIENT_REQUEST} -- Curl implementation
;note
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software