On Oct 22, 2006 1:21 AM, Dr Gerard Hammond wrote: > Thanks for the code. I like it and I use it but bec careful > with this. > I recommend that you change it to: > > Function AsText(Extends i as integer, fmt as string = "-0") > As string > return DefineEncoding(Format(i, fmt), Encodings.UTF8) > End Function > > > The top version returns a NIL encoded string and if you later > concatenate this with another string, the resulting string > will also have a NIL encoding and then you can get bitten by > some subtle (ie catastrophic) differences with InStr(), > countStr etc. > > The bottom one fixes this nasty little creepy crawly .... > > (Can you tell I just got bitten by it...)
On Windows 2000 by using just "Return Format(i, fmt)" returns a UTF-8 string - at least that's what is shows on debugger. Tested with 2005r4 and 2006r4. Carlos _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives of this list here: <http://support.realsoftware.com/listarchives/lists.html>
