MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / _UInt

Function _UInt

extern/re2/re2/unicode.py:30–49  ·  view source on GitHub ↗

Converts string to Unicode code point ('263A' => 0x263a). Args: s: string to convert Returns: Unicode code point Raises: InputError: the string is not a valid Unicode value.

(s)

Source from the content-addressed store, hash-verified

28
29
30def _UInt(s):
31 """Converts string to Unicode code point ('263A' => 0x263a).
32
33 Args:
34 s: string to convert
35
36 Returns:
37 Unicode code point
38
39 Raises:
40 InputError: the string is not a valid Unicode value.
41 """
42
43 try:
44 v = int(s, 16)
45 except ValueError:
46 v = -1
47 if len(s) < 4 or len(s) > 6 or v < 0 or v > _RUNE_MAX:
48 raise InputError("invalid Unicode value %s" % (s,))
49 return v
50
51
52def _URange(s):

Callers 2

_URangeFunction · 0.85
DoLineFunction · 0.85

Calls 2

intFunction · 0.85
InputErrorClass · 0.85

Tested by

no test coverage detected