Notebook Worksheet Unicode Problem

์กฐํšŒ์ˆ˜ 13ํšŒ
์ฝ์ง€ ์•Š์€ ์ฒซ ๋ฉ”์‹œ์ง€๋กœ ๊ฑด๋„ˆ๋›ฐ๊ธฐ

NoSyu

์ฝ์ง€ ์•Š์Œ,
2009. 7. 4. AM 9:55:5509. 7. 4.
๋ฐ›๋Š”์‚ฌ๋žŒ sage-devel
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

Minh Nguyen

์ฝ์ง€ ์•Š์Œ,
2009. 7. 4. PM 2:30:2009. 7. 4.
๋ฐ›๋Š”์‚ฌ๋žŒ sage-...@googlegroups.com
Hi,

On Sat, Jul 4, 2009 at 11:55 PM, NoSyu<don...@gmail.com> wrote:
>
> 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

<SNIP>

Ticket #6417 seems to be related to this. This will be shipped with Sage 4.1.

--
Regards
Minh Van Nguyen

NoSyu

์ฝ์ง€ ์•Š์Œ,
2009. 7. 4. PM 8:56:3809. 7. 4.
๋ฐ›๋Š”์‚ฌ๋žŒ sage-devel
Hello

There is a better solution.

Thanks to introduce the ticket.^^

Minh Nguyen

์ฝ์ง€ ์•Š์Œ,
2009. 7. 4. PM 10:10:0709. 7. 4.
๋ฐ›๋Š”์‚ฌ๋žŒ sage-...@googlegroups.com
Hi,

On Sat, Jul 4, 2009 at 11:55 PM, NoSyu<don...@gmail.com> wrote:
>

<SNIP>

> 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'))

This is now ticket #6464:

http://trac.sagemath.org/sage_trac/ticket/6464

Thank you for reporting.

์ „์ฒด๋‹ต์žฅ
์ž‘์„ฑ์ž์—๊ฒŒ ๋‹ต๊ธ€
์ „๋‹ฌ
์ƒˆ ๋ฉ”์‹œ์ง€ 0๊ฐœ