Fwd: [MLton-user] unicode again
Sean McLaughlin
seanmcl at gmail.com
Thu Apr 29 18:21:22 PDT 2010
Hi,
I can't figure out how to use the \U syntax to enter unicode strings. For
example
from a former post about unicode:
>
> MLton supports \Uxxxxxxxx escape sequences for describing characters with
> ordinal value greater than 2^16. (The SML Definition allows \uxxxx.)
> Note that the overload resolution depends on how the value is used, not the
> constant that defines it; so, you might need a WideString.string constraint.
>
>
Say I want to enter the unicode forall (∀). The unicode hex value is
E28880. If I translate this to the 8 bit escape sequence I can print it:
val _ = print "\226\136\128"
prints ∀
This conversion is a bit painful though. The unicode point value is \U2200,
but I can't get MLton to compile either of these:
val _ = print "\U2200"
val _ = print (WideString.toString ("\U2200" : WideString.string))
What am I doing wrong?
Thank you!
Sean
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mlton.org/pipermail/mlton-user/attachments/20100429/6825eb16/attachment.htm
More information about the MLton-user
mailing list