From: JVZ <je...@fo...> - 2014-01-14 22:37:32
|
On Tue, 14 Jan 2014 22:33:48 +0100 pof <jd3...@gm...> wrote: >Hi all, > >In Fox1.7.37, I used to define strings with greeks symbols (here a small >sigma) using: > FXString stSigma_z = fromAscii("\\u03C3_z"); > >In Fox 1.7.45, any idea what should I use instead of fromAscii which no >longer exists? The capability to escape/unescape unicode hex, formerly in fromAscii() and toAscii(), has been rolled into escape() and unescape(). The flag parameter in escape() determines treatment of non-ascii bytes in the input. If flag==2, then legal utf8 will be escaped as one or two "\uHHHH" escape sequences. If flag==1 then non-ascii bytes will be escaped as plain hex, like "\xHH". If the flag==0 then only control-codes in the input will be escaped. This is useful if the consumer of the string can actually print normal UTF8 characters. The new implementation of unescape() now knows about \uHHHH and knows how to deal with escaped surrogate pairs as well. [It was mentioned in the october 2013 announcement, BTW!] Regards, -- JVZ +----------------------------------------------------------------------------+ | Copyright (C) 16:10 06/28/2013 Jeroen van der Zijp. All Rights Reserved. | +----------------------------------------------------------------------------+ |