Thanks, all went normally, but I stacked with creating pixbuf from image.
I decided to use this:
[https://pp.vk.me/c638428/v638428447/13ff8/5by3ijiErV4.jpg](https://pp.vk.me/c638428/v638428447/13ff8/5by3ijiErV4.jpg)
function, but I got an error:
[https://pp.vk.me/c638428/v638428447/13fef/309fNg
@Krux02, maybe this is a bug, you could post an issue on GitHub.
no, I am asking for the inverse of that function. There is unescape, but it
doesn't do what I want to do:
import strutils
let str = r"\n\r"
echo str
assert unescape(str, "", "") == "\n\r"
Well, more meaningful and even more funny is this code with random numbers,
where the compilers really can not remove the proc calls:
import random
proc rdtsc(): int64 =
var hi, lo: uint32
asm """
rdtsc
:"=a"(`lo`), "=d"(`hi`)
"""
result =
proc rdtsc(): int64 =
var hi, lo: uint32
asm """
rdtsc
:"=a"(`lo`), "=d"(`hi`)
"""
result = int64(lo) or (int64(hi) shl 32)
proc sort1(d: var openarray[int]) =
template SWAP(x, y: int) =
let a = min(d[x], d[y])
let b = max(
Perhaps you want strutils.escape? I.e.:
import strutils
echo escape("\n\t")
Output is "\x0A\x09"
Its output is designed to be as portable an 'input' to
de-escapers/escape-interpreters as possible. So you will see things like \x0A
and \x09 instead of the \n \t because the
I have a macro with a string argument. The string is partially preserved, but
all n from the string are now litterally n and t. so how do I unescape
thesevalues to create a string object out of them? All my ideas right now feel
like a lot of work with some uncertenty if I did everything correct,