Hi All,<div><br></div><div>I fixed issues. Some comments: </div><div>> Are these files always guaranteed to be available, or are some <a href="http://configure.ac">configure.ac</a> checks required in this change?</div><div>

I'm not sure that checking is required because 'locale.h' is in standard C library. Please correct me if I mistaken.</div><div><br></div><div>> <span style="background-color:rgb(255,255,255);color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.800000190734863px">Did you investigate if this function will handle UTF-8 data </span><span style="background-color:rgb(255,255,255);color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.800000190734863px">correctly? I sure don't know that.</span></div>

<div><span style="background-color:rgb(255,255,255);color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.800000190734863px">UTF-8 text is now not going from </span><font color="#222222" face="arial, sans-serif">gsm480_rx_ussd function since terminal with telnet which is connected to mobile app can not support UTF-8 and there is no way to check it.</font></div>

<div><font color="#222222" face="arial, sans-serif"><br></font></div><div><font color="#222222" face="arial, sans-serif">> I hope a better name than DSC_0f can be found</font></div><div><font color="#222222" face="arial, sans-serif">Author of gsm480_ss.c unfortunately does not remember why 0x0f constant is used but if it's works and text is decoded as GSM 7bit - I changed name to default3, hope it's ok.</font></div>

<div><br></div><div>And now I have 3 variants of patch:</div><div><br></div><div>ussd-ucs2.setlocale.patch - with setlocale function. locale is set to "Environment's default locale" with setlocale(LC_ALL, "") and then restored to previous. Calling of setlocale(LC_ALL, NULL) returns "C" (Minimal "C" locale) and this is not what I want, so I have to manually set locale to Env default and check if it's UTF-8. As I understand this variant is not desirable.</div>

<div><br></div><div>ussd-ucs2.pipe.patch - locale is obtained from system shell with 'locale' command. I can't think another method to check locale except calling 'locale' or function 'setlocale'. If someone knows - please let me know.<br>

<br>ussd-ucs2.hex.patch - compromise variant (no external programs calls, no functions that affects whole app). Just convert text from UCS2 to UTF-8 and print hex representation of the string.</div><div><br></div><div>Thanks,</div>

<div>Pavel<br><br><div class="gmail_quote">On Sat, Sep 22, 2012 at 1:57 PM, Holger Hans Peter Freyther <span dir="ltr"><<a href="mailto:holger@freyther.de" target="_blank">holger@freyther.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im">On Wed, Sep 19, 2012 at 09:49:29PM +0000, Pavel Baturko wrote:<br>
> Thanks for advises! New version: if received text in UCS2, convert it to<br>
> UTF-8, then check if console supports UTF-8, if yes - print message in vty<br>
> as usual, if not - print message in hex.<br>
<br>
</div>Hi Pavel,<br>
<br>
thanks for updating the patch. Could you remove the calls to setlocale and<br>
move the actual ucs->utf8 folding into a new subroutine.<br>
<br>
thanks<br>
<span class="HOEnZb"><font color="#888888"><br>
        holger<br>
<br>
</font></span></blockquote></div><br></div>