maheshwarirohit87 / typica

Automatically exported from code.google.com/p/typica
Apache License 2.0
0 stars 0 forks source link

SDB item id with an accented character (like é) #49

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Saving an item id with an accented character (like é)

Domain test = sdb.getDomain("test");
Item item = test.getItem("café");
List<ItemAttribute> attrs = new ArrayList<ItemAttribute>();
attrs.add(new ItemAttribute("name","value",true));
item.putAttributes(attrs);

What is the expected output? What do you see instead?
Expected: the item is saved
Instead: Client error : The request signature we calculated does not match
the signature you provided. Check your AWS Secret Access Key and signing
method. Consult the service documentation for details.

What version of the product are you using? On what operating system?
Typica 1.5.1
Windows Vista

Please provide any additional information below.
When using the Firefox SimpleDB plugin, I'm able to use accents.

Original issue reported on code.google.com by onthoo on 13 Apr 2009 at 1:54

GoogleCodeExporter commented 9 years ago
I'm seeing that too with SimpleDB, same as Pieter reported

Typica 1.5.1
MacOSX 10.5.6
Java 1.6

Our workaround has been to use URLEncoder.encode() to escape those accented
characters in attributes.

Original comment by cet...@gmail.com on 16 Apr 2009 at 8:56

GoogleCodeExporter commented 9 years ago
I'm seeing the same problem with SDB as the other people -- i.e., the inability 
to handle non-english characters. 
What's interesting though is that when using typica 1.4.1 this problem didn't 
exist. However, it's only been upon 
upgrading to typica 1.5.1 that I"m seeing this problem for the first time.

Original comment by invoke.c...@gmail.com on 20 Apr 2009 at 8:05

GoogleCodeExporter commented 9 years ago
I'm seeing this also, with special characters (æøå) in attribute values.

Original comment by wat...@gmail.com on 5 May 2009 at 6:33

GoogleCodeExporter commented 9 years ago
I fixed this issue. My diff:
Index: java/com/xerox/amazonws/common/AWSConnection.java
===================================================================
--- java/com/xerox/amazonws/common/AWSConnection.java   (revision 258)
+++ java/com/xerox/amazonws/common/AWSConnection.java   (working copy)
@@ -223,13 +223,15 @@
                String encoded = unencoded;
         try {
             encoded = URLEncoder.encode(unencoded, "UTF-8");
+            if ( sigVersion == 2 ) {
+              encoded = encoded.replace("+", "%20");
+              encoded = encoded.replace("*", "%2A");
+              encoded = encoded.replaceAll("%7E", "~");
+            }
         } catch (UnsupportedEncodingException e) {
             // should never happen
             throw new RuntimeException("Could not url encode to UTF-8", e);
         }
-               if (sigVersion == 2) {
-                       encoded = URLEncoder.encode(unencoded).replace("+", 
"%20").replace("*", "%2A").replace("%7E", "~");
-               }
                return encoded;
     }
 }

Original comment by sharifmarat@gmail.com on 14 May 2009 at 11:12

GoogleCodeExporter commented 9 years ago
This seems to be fixed in typica-1.5.2a

Original comment by onthoo on 14 May 2009 at 1:14

GoogleCodeExporter commented 9 years ago
I had got problems with russian letters in typica-1.5.2a with sigVersion=2 
until my 
fix.

Original comment by sharifmarat@gmail.com on 14 May 2009 at 1:24

GoogleCodeExporter commented 9 years ago
I've made this change in SVN r283. Thanks!

Original comment by dkavan...@gmail.com on 7 Oct 2009 at 7:22

GoogleCodeExporter commented 9 years ago

Original comment by dkavan...@gmail.com on 7 Oct 2009 at 7:23