<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p><tt>Hi SamyGo,</tt></p>
<p><tt>The rest_post() function seems to properly put _any_ given
bytes on the wire:</tt></p>
<p><tt>$var(body) = "SIP璎XXX璎SIP";</tt><tt><br>
</tt><tt>$var(ctype) = "text/plain";</tt><tt><br>
</tt><tt>rest_post(<a class="moz-txt-link-rfc2396E"
href="http://127.0.0.1">"http://127.0.0.1"</a>, "$var(body)",
"$var(ctype)", "$var(retcode)");</tt></p>
<p><tt>produces:</tt></p>
<p><tt> 0x0000: 4500 00a2 67cc 4000 4006 d487 7f00 0001 <a
class="moz-txt-link-abbreviated" href="mailto:E...g.@.@">E...g.@.@</a>.......<br>
0x0010: 7f00 0001 8e1d 0050 febf 3131 bf5f d711
.......P..11._..<br>
0x0020: 8018 0156 fe96 0000 0101 080a 0142 56fa
...V.........BV.<br>
0x0030: 0142 56fa 504f 5354 202f 2048 5454 502f
.BV.POST./.HTTP/<br>
0x0040: 312e 310d 0a48 6f73 743a 2031 3237 2e30
1.1..Host:.127.0<br>
0x0050: 2e30 2e31 0d0a 4163 6365 7074 3a20 2a2f
.0.1..Accept:.*/<br>
0x0060: 2a0d 0a43 6f6e 7465 6e74 2d54 7970 653a
*..Content-Type:<br>
0x0070: 2074 6578 742f 706c 6169 6e0d 0a43 6f6e
.text/plain..Con<br>
0x0080: 7465 6e74 2d4c 656e 6774 683a 2031 350d
tent-Length:.15.<br>
0x0090: 0a0d 0a53 4950 e792 8e58 5858 e792 8e53
...SIP...XXX...S<br>
0x00a0: 4950 IP</tt></p>
<p><tt>The command I used for capturing is:</tt></p>
<p><tt>tcpdump -nnvvXSs 1514 -i any port 80<br>
</tt></p>
<p><tt>Please let me know if behavior differs on your platform.</tt></p>
<p><tt>Regards,<br>
</tt></p>
<pre class="moz-signature" cols="72">Liviu Chircu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a>
OpenSIPS Summit May 2017 Amsterdam
<a class="moz-txt-link-freetext" href="http://www.opensips.org/events/Summit-2017Amsterdam.html">http://www.opensips.org/events/Summit-2017Amsterdam.html</a></pre>
<div class="moz-cite-prefix">On 28.03.2017 19:55, SamyGo wrote:<br>
</div>
<blockquote
cite="mid:CAJUJwtg-7sgc11AkAAXaAENB3=EjpkY33vxhyvWbTn1Vte1mdQ@mail.gmail.com"
type="cite">
<div dir="ltr">Hi,
<div><br>
<div>I've a specific problem with avps containing values in
language other than English. For example an avp(test)
holding a Chinese character gets converted to ? while
passing to some rest_post URL.</div>
<div><br>
</div>
<div><u>code:</u></div>
<div><br>
</div>
<div><font face="monospace, monospace">$avp(test) = $fn;</font></div>
<div><font face="monospace, monospace">xlog("L_INFO","Got
Display Name: $avp(test) \n");</font></div>
<div><font face="monospace, monospace">rest_post("$avp(url)","$avp(test)"
....);</font></div>
<div><br>
</div>
<div><br>
</div>
<div>The output in x-log line stays correct but the webserver
gets the value of $avp(test) converted in "...??.." <br>
</div>
<div><br>
</div>
<div>I've tried to add the charset=utf-8 in the content-type
header but it doesn't help.</div>
<div><br>
</div>
<div>Looking forward to get some hints/help on this.</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Sammy</div>
<div><br>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>