Hi David,

We should really be passing the charset with the request. I'll get that fixed soon as I have some other changes to make in that area.

It's interesting though, reading the latest ACF docs, that it sounds like the CHARSET attribute is supposed to serve dual purposes - setting the character encoding of the request and providing the ability to override that of the response.

Andy

On 03/04/2012 08:57, David G Ortega wrote:
Hi guys,

finally viewing the data with a proxy seemed that the data was
properly encoded in UTF-8 but especifying the charset into the cfhttp
tag didn't work. Finally I had the idea of sending the content type
with the charset especification and it worked.

<cfhttp method='post' url='http://localhost:9200/chingame/ads/
#ad.id#' result='httpRequest' timeout='20'  charset="utf-8">
<cfhttpparam type="header" name="Content-Type" value="application/
json; charset=utf-8" />
<cfhttpparam type='body', value='#ad.json#'>
</cfhttp>

On 2 abr, 23:41, David G Ortega<[email protected]>  wrote:
sorry Matthew I posted it wrong!

Here it is

<cfscript>
         ad                              = {};
         ad.title                = "Joe's Café&  Bar";
         ad.desc                 = 'ñ € í';
         ad.address              = '29600 Marbella Malaga';

         ad.id                   = hash(serializeJSON( ad.title ), 'MD5');
         ad.date                 = requestKey('date', dateFormat(now(), 
'yyyy-mm-dd')&  'T'
&  timeFormat(now(), 'HH:mm:ss'));

         ad.json = serializeJSON(ad);
</cfscript>

         <cfhttp method='post' url='http://localhost:9200/chingame/ads/
#ad.id#' result='httpRequest' timeout='20'  charset="utf-8">
                 <cfhttpparam type='body', value='#ad.json#'>
         </cfhttp>

         <cfscript>
         writeDump(httpRequest);
         </cfscript>

On 2 abr, 23:38, David G Ortega<[email protected]>  wrote:







Sure Matthew,
this is the code reduced to the bare minimum
<cfscript>
         ad                              = {};
         ad.title                = "Joe's Café&  Bar";
         ad.desc                 = 'ñ € í';
         ad.address              = '29600 Marbella Malaga';
         ad.id                   = hash(serializeJSON( ad.title ), 'MD5');
         ad.date                 = dateFormat(now(), 'yyyy-mm-dd')&  'T'&  
timeFormat(now(),
'HH:mm:ss');
         ad.json = serializeJSON(ad);
         <cfhttp method='post' url='http://localhost:9200/chingame/ads/
#ad.id#' result='httpRequest' timeout='20'  charset="utf-8">
                 <cfhttpparam type='body', value='#ad.json#'>
         </cfhttp>
         <cfscript>
         writeDump(httpRequest);
         </cfscript>
</cfscript>
serializeJSON seems to not being encoding to UTF8
On 2 abr, 23:28, Matthew Woodward<[email protected]>  wrote:
On Mon, Apr 2, 2012 at 2:25 PM, David G Ortega<[email protected]>wrote:
for similar post Railo is sending this
{"LNKSRC":"","ID":"BF2A25AF8A4568D899AEE7806BD74904","TITLE":"Joe's Caf
\u00e9&  Bar","DESC":"\u00f1 \u20ac \u00ed","LNKHREF":"\/
BF2A25AF8A4568D899AEE7806BD74904","ADDRESS":"<a>29600 Marbella Malaga<
\/a>","IMAGES":[],"DATE":"2012-04-02T23:21:33"}
which is working...
It would be helpful to see the code around what you're doing as opposed to
just the resultant json string.
--
Matthew Woodward
[email protected]http://blog.mattwoodward.com
identi.ca / Twitter: @mpwoodward
Please do not send me proprietary file formats such as Word, PowerPoint,
etc. as attachments.http://www.gnu.org/philosophy/no-word-attachments.html

--
online documentation: http://openbd.org/manual/
  google+ hints/tips: https://plus.google.com/115990347459711259462
    http://groups.google.com/group/openbd?hl=en

Reply via email to