Hello.

I use Sagemath to show the Linear Algebra problems solution.

And I am Korean.

Therefore I write the comments in Korean using p or div html tag in
worksheet like this.

http://nosyu.pe.kr/attach/1/5682987737.png


If I want to modify the sentence, I just double click the sentence.
Then modified textarea is appeared.

But if the sentence is written in Korean, the character is broken like
this.

http://nosyu.pe.kr/attach/1/5274736490.png

So I click the 'save changes', then broken sentence is saved. Of
course, I can't read it.

http://nosyu.pe.kr/attach/1/4710829034.png


The reason is that worksheet html code is like this.

data   : '<p>\xea\xb3\xb5\xec\x8b\x9d\xec\x97\x90 \xeb\x94\xb0\xeb\x9d
\xbc \xed\x95\xa8\xec\x88\x98\xeb\xa5\xbc \xec\xa0\x95\xec\x9d\x98\xed
\x95\x98\xec\x98\x80\xec\x8a\xb5\xeb\x8b\x88\xeb\x8b\xa4.</p>'

It is just unicode number. So web browser doesn't understand this.



So I find the python code and modify it.

sageroot/devel/sage/sage/server/notebook/cell.py:211

211 : </script>"""%(self.__id,self.__id,self.__text)

=>

211 : </script>"""%(self.__id,self.__id,((self.__text).decode
('utf-8')).encode('ascii', 'xmlcharrefreplace'))

then I can see the right character in modified textarea.

http://nosyu.pe.kr/attach/1/1598983532.png

Now worksheet html is like this.

data   : '<p>&#44277;&#49885;&#50640; &#46384;&#46972;
&#54632;&#49688;&#47484;
&#51221;&#51032;&#54616;&#50688;&#49845;&#45768;&#45796;.</p>'



Therefore I suggest that the code is rewrite to handle the unicode
characters.



I write about it in my blog.(Sorry, it is writen in Korean.)

http://nosyu.pe.kr/2039


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to