File: utf.d

package info (click to toggle)
sambamba 1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,528 kB
  • sloc: sh: 220; python: 166; ruby: 147; makefile: 103
file content (21 lines) | stat: -rw-r--r-- 599 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/**
 * Contains the obsolete functions from Phobos' `std.utf`.
 */
module contrib.undead.utf;

import std.utf;
import std.typecons;

//deprecated("Removed October 2017. Please use std.utf.encode instead.")
char[] toUTF8(return out char[4] buf, dchar c) nothrow @nogc @safe pure
{
    const sz = encode!(Yes.useReplacementDchar)(buf, c);
    return buf[0 .. sz];
}

//deprecated("Removed October 2017. Please use std.utf.encode instead.")
wchar[] toUTF16(return ref wchar[2] buf, dchar c) nothrow @nogc @safe pure
{
    const sz = encode!(Yes.useReplacementDchar)(buf, c);
    return buf[0 .. sz];
}