-
-
Notifications
You must be signed in to change notification settings - Fork 397
/
string.pyx
33 lines (25 loc) · 1.04 KB
/
string.pyx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# -*- encoding: utf-8 -*-
"""
String <-> bytes encoding/decoding
TESTS:
Check that this can be used outside of Sage (see :trac:`25549`)::
sage: cython('''
....: from sage.cpython.string cimport char_to_str
....: print(char_to_str("hello world!"))
....: ''')
hello world!
"""
#*****************************************************************************
# Copyright (C) 2017 Erik M. Bray <erik.bray@lri.fr>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
# http://www.gnu.org/licenses/
#*****************************************************************************
import sys
# Provide this as a shortcut to calling sys.getfilesystemencoding(), which
# after interpreter initialization is constant.
FS_ENCODING = sys.getfilesystemencoding()
# Functions in this module are implemented in the .pxd file for inlining.