On Sep 5, 8:57 am, Rohit <[EMAIL PROTECTED]> wrote: > On Sep 5, 2:10 am, Folke <[EMAIL PROTECTED]> wrote: > > But if by US-ASCII you mean the full 8-bit (which is not US-ASCII) > > then you already have your safe 8-bit multibyte sequence with UTF-8. > > Zero-termination is still a problem, though. Use a simple regular > > expression to escape and unescape 0-bytes and your escape character > > (e.g. \). > > hmm.. I am getting confused here. Let me try asking the question in > other words. I have two layers one is gwt based(java) front end and > back end with uclibc without wchar support. What i am trying to > achieve is keep uclibc as it is (without wchar support). Use case is > front end should be able to accept US-ASCII data + UTF-8 data as > input , send it to back end which stores it in a file and returns back > to front end which should be able to render it correctly. Functions > present in back end depends heavily on null termination property of > input data and as long as possible i would like to avoid it.If my gwt > based layer sends all strings in such way that it will not have '\0' > in between (strings like this is possible as front end supports UTF-8 > input)but only at the end, then its enough for me.
So, you have a small webserver running on some device hooked to the network. The stuff on your device uses uClibc without wchar support. Now you want to write a browser application with GWT, i.e. an administration interface for this device. Am I close? Personally, I think you should let your webserver escape und unescape the \0 bytes before handing the data to your back-end application. This would make your device more robust and probably safer. However, if you want to do this inside your client app before sending it over the network you can use URL.encode() or regular expressions. http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/http/client/URL.html#encode(java.lang.String) http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/http/client/RequestBuilder.html#setRequestData(java.lang.String) > I was hoping wctomb would covert a unicode char which in normal case > if treated as single byte char sequence might have '\0' in it, to a > multi byte sequence(might be more than 2 bytes if required) which will > not have '\0' but correct me if i am wrong. No, wctomb(3) just converts your \0 wide character to one \0 byte. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
