Backslash

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Backslash

Vance Shipley
What is the magic to make this return "\u0080"?

   1> io_lib:fwrite("\u~4.16.0b", [128]).
   "u0080"
   2> io_lib:fwrite("\\u~4.16.0b", [128]).
   "\\u0080"

--
     -Vance
Reply | Threaded
Open this post in threaded view
|

Re: Backslash

Marc Worrell
The last one returned what you want.

1> "\u".
"u"
2> "\\u".
"\\u"
3> [ $\\, $u ].
"\\u"

It show two ‘\’ characters because “\” is the escape character and it must be escaped.

- Marc


> On 26 Mar 2020, at 11:26, Vance Shipley <[hidden email]> wrote:
>
> What is the magic to make this return "\u0080"?
>
>    1> io_lib:fwrite("\u~4.16.0b", [128]).
>    "u0080"
>    2> io_lib:fwrite("\\u~4.16.0b", [128]).
>    "\\u0080"
>
> --
>      -Vance