ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 20 Jan 2021 15:44:24 +0100Issues with Reed-Solomon encoderhttps://ask.sagemath.org/question/55386/issues-with-reed-solomon-encoder/I am trying out the Reed-Solomon encoder in Sage and I have found it to exhibit a curious behavior. I first create an encoder for a $(7,3)$-Reed Solomon code as follows
sage: F.<a> = GF(8,name='a',modulus=x^3+x+1)
....: Fx.<x> = F[]
....: C = codes.ReedSolomonCode(F, 7, 3)
....: E = C.encoder("EvaluationPolynomial")
Now I can write
sage: E.encode(x)
(1, a, a^2, a + 1, a^2 + a, a^2 + a + 1, a^2 + 1)
Or
sage: E.encode(a*x^0+a^2*x+x^2)
(a^2 + a + 1, a^2 + 1, a, 0, a^2 + 1, 0, a^2 + a + 1)
But I get when I write the following
sage: E.encode(a)
I get the following error
"AttributeError: 'sage.rings.finite_rings.element_givaro.FiniteField_givaroElement' object has no attribute 'degree'"
If I instead write
sage: E.encode(a*x^0)
Everything works as intended. Is this how it is supposed to work? Does one always need an "$x$" to be part of a term, even when one actually has a constant term? Is there a better way to do it? joakim_uhlinWed, 20 Jan 2021 15:44:24 +0100https://ask.sagemath.org/question/55386/problem with encoding & german charactershttps://ask.sagemath.org/question/33555/problem-with-encoding-german-characters/ Hi there,
when I'm using special german characters like 'ä' a sagecell in an html document the whole cell crashes without doing anything (not even printing an error message). I encoded the webpage in UTF-8 and added the needed meta tag fpr this encoding as well. The error occurs whenever I'm typing these characters inside the sage code block (even when they are just used in a # comment.)
This behavior is new, since I worked a couple of days ago. I tried setting the encoding of python inside the script as well without any effect. The standard encoding is ASCII. (tested via sys.getdefaultencoding() ) Even using the .encode('utf-8') method for stings fails :(
Will this be fixed? Or is there any known workaround?
Kind regards,
KwasniokKwasniokThu, 26 May 2016 18:06:00 +0200https://ask.sagemath.org/question/33555/character encodinghttps://ask.sagemath.org/question/26556/character-encoding/ How can I chgange characte encoding in Sage notebook. I'm hungarian, and in string I need characterd like á, ő, ű, etc, but not \xc3, \xc5 and so on.czsanThu, 16 Apr 2015 10:57:45 +0200https://ask.sagemath.org/question/26556/