Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
HBase, mail # user - Problem with url encode for http rest CLIENT


Copy link to this message
-
Re: Problem with url encode for http rest CLIENT
Suraj Varma 2011-11-03, 08:04
You are running into encoding issues. Likely, you are posting data
that is not UTF-8 as UTF-8 (i.e. your post XML says cell value is
"utf-8" ... but it is not). This results in the data not being
recognized and replaced with ef bf bd which is the unicode replacement
character; Google for "ef bf bd unicode" for a lot of links related to
this.

Solution would be to convert your data into utf-8 before posting.
--Suraj

On Wed, Oct 26, 2011 at 4:17 PM, ChongQing Xiao <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I found a strange problem with http REST post.
>
> I post a dat through the following URL
> "/AAA/1000_1_100_%00%00%00d%00%06%1A%80/D:V"
>
> and it works correctly, but when I query the same address using get,
> I get the following xml result
>
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?><CellSet><Row key="MTAwMF
> 8xXzEwMF8AAABkAAYa77+9"><Cell timestamp="1319664990595" column="RDpW">YWRi</Cell
>></Row></CellSet>
>
> The problem is if I decode the key, it is different from my post URL
> "/AAA/1000_1_100_%00%00%00%64%00%06%1A%EF%BF%BD/D:V
> The same key displays from the hbase shell.
>
> Somehow, the %80 is translated to %EF%BF%BD,
> The strange thing is I can still get the same data using both of the URLs.
>
> I am using the stable version 0.9.04.
>
> Does anyone know what is causing this?
> Any suggestion will be greatly appreciated.
>
> Thanks
> Chong
>
>
>
>
>
>