Yeah, I'm pretty sure there's just a misunderstanding somewhere along the line.
According to the code I see in Swift, it has supported Unicode names with COPY/Destination (and PUT/X-Copy-From) for quite some time (since the beginning of OpenStack?) but all strings sent to Swift need to be UTF-8 and URL encoded.
There was a problem with this with the large object support (X-Object-Manifest) but that was fixed about a month and half ago -- not exactly related to this particular bug.
The key here is: Path strings and header values sent to Swift need to be UTF-8 and URL encoded -- sometimes you can get away with not doing it, but it's not a supported thing when you do.
For instance, the previous example should really be using %E5%B9%B8%E7%A6%8F for the Unicode value. The following quick snippet should show this (but I guess it depends on your Terminal; mine UTF-8 encodes strings from the command line):
Yeah, I'm pretty sure there's just a misunderstanding somewhere along the line.
According to the code I see in Swift, it has supported Unicode names with COPY/Destination (and PUT/X-Copy-From) for quite some time (since the beginning of OpenStack?) but all strings sent to Swift need to be UTF-8 and URL encoded.
There was a problem with this with the large object support (X-Object-Manifest) but that was fixed about a month and half ago -- not exactly related to this particular bug.
The key here is: Path strings and header values sent to Swift need to be UTF-8 and URL encoded -- sometimes you can get away with not doing it, but it's not a supported thing when you do.
For instance, the previous example should really be using %E5%B9%B8%E7%A6%8F for the Unicode value. The following quick snippet should show this (but I guess it depends on your Terminal; mine UTF-8 encodes strings from the command line):
python -c 'import sys, urllib; print urllib. quote(sys. argv[-1] )' 幸福
%E5%B9%B8%E7%A6%8F
With that as the UTF-8/URL-Encoded string, the example should've been:
$ echo test > OBJECT Meta-Orig- Filename: %E5%B9% B8%E7%A6% 8F octet-stream fd7cb4cb0031ba2 49 Meta-Orig- Filename: %E5%B9%B8%E7%A6%8F
$ swift upload CONTAINER OBJECT
OBJECT
$ swift post CONTAINER OBJECT -m X-Object-
$ swift stat CONTAINER OBJECT
Account: AUTH_test
Container: CONTAINER
Object: OBJECT
Content Type: application/
Content Length: 5
Last Modified: Wed, 15 Aug 2012 01:17:08 GMT
ETag: d8e8fca2dc0f896
Meta X-Object-
Accept-Ranges: bytes
X-Timestamp: 1344993428.16163
Let's do another example with the value as the object name, including a copy/destination and a put/x-copy-from.
$ curl -XPUT http:// 127.0.0. 1:8080/ v1/AUTH_ test/CONTAINER/ %E5%B9% B8%E7%A6% 8F -Hx-auth- token:AUTH_ tkc10eb54529004 c0d91e5ca3310ee 7a09 --data-binary 'test' 127.0.0. 1:8080/ v1/AUTH_ test/CONTAINER/ %E5%B9% B8%E7%A6% 8F -Hx-auth- token:AUTH_ tkc10eb54529004 c0d91e5ca3310ee 7a09 -Hdestination: /CONTAINER/ copied 127.0.0. 1:8080/ v1/AUTH_ test/CONTAINER/ x-copy- fromed -Hx-auth- token:AUTH_ tkc10eb54529004 c0d91e5ca3310ee 7a09 -Hx-copy- from:/CONTAINER /%E5%B9% B8%E7%A6% 8F -Hcontent-length:0 127.0.0. 1:8080/ v1/AUTH_ test/CONTAINER? format= json -Hx-auth- token:AUTH_ tkc10eb54529004 c0d91e5ca3310ee 7a09 -s | python -mjson.tool
"content_ type": "application/ octet-stream" , 6fd7cb4cb0031ba 249",
"last_ modified" : "2012-08- 15T01:17: 08.161630" ,
"content_ type": "application/ x-www-form- urlencoded" , 73cade4e832627b 4f6",
"last_ modified" : "2012-08- 15T01:30: 58.755590" ,
"content_ type": "application/ x-www-form- urlencoded" , 73cade4e832627b 4f6",
"last_ modified" : "2012-08- 15T01:32: 51.507340" ,
"content_ type": "application/ x-www-form- urlencoded" , 73cade4e832627b 4f6",
"last_ modified" : "2012-08- 15T01:26: 36.678980" ,
201 Created
$ curl -XCOPY http://
201 Created
$ curl -XPUT http://
201 Created
$ curl http://
[
{
"bytes": 5,
"hash": "d8e8fca2dc0f89
"name": "OBJECT"
},
{
"bytes": 4,
"hash": "098f6bcd4621d3
"name": "copied"
},
{
"bytes": 4,
"hash": "098f6bcd4621d3
"name": "x-copy-fromed"
},
{
"bytes": 4,
"hash": "098f6bcd4621d3
"name": "\u5e78\u798f"
}
]