diff options
author | Eevee (Alex Munroe) <eevee.git@veekun.com> | 2014-03-29 16:47:01 -0700 |
---|---|---|
committer | Eevee (Alex Munroe) <eevee.git@veekun.com> | 2014-03-29 16:47:01 -0700 |
commit | 48507954f5806f073ad4d913edc919dc92d933e9 (patch) | |
tree | b08b5af77fddc35e4e06ec178283e916bce4dd14 /scss/cssdefs.py | |
parent | e97461c577435fcb1e19da39e19af48437ea591f (diff) | |
download | pyscss-48507954f5806f073ad4d913edc919dc92d933e9.tar.gz |
Make the internals all use unicode, even on py2.
This was happening on py3 anyway, so might as well try to be
Unicode-clean everywhere.
The CSS charset detection is not actually implemented yet.
Also, speedups are now totally broken on py2. Please hold.
Diffstat (limited to 'scss/cssdefs.py')
-rw-r--r-- | scss/cssdefs.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/scss/cssdefs.py b/scss/cssdefs.py index 7b73805..bfd6b19 100644 --- a/scss/cssdefs.py +++ b/scss/cssdefs.py @@ -1,3 +1,6 @@ +"""Constants and functions defined by the CSS specification, not specific to +Sass. +""" from math import pi import re @@ -339,6 +342,24 @@ def is_builtin_css_function(name): return False # ------------------------------------------------------------------------------ +# CSS character set determination +# Based upon: http://www.w3.org/TR/CSS2/syndata.html#charset + +def determine_encoding(f): + """Return the appropriate encoding for the given file, according to the CSS + charset rules. + + `f` should be a file-like object, opened in binary mode with the cursor at + the beginning. + """ + # TODO haha. + + # This is the ultimate default: just assume UTF-8 + return "UTF-8" + + + +# ------------------------------------------------------------------------------ # Bits and pieces of grammar, as regexen SEPARATOR = '\x00' |