It might be that it treats new lines as \r\n when you are using some windows-* encoding for your html pages. Check the source code. I would rather use UTF-8 in any case.
Regards Aidas Bendoraitis [aka Archatas] On 12/13/06, zhongke chen <[EMAIL PROTECTED]> wrote: > thanks a lot. problem fixed as you said. > > I use Firefox under linux. does it treat newline as \r\n?? > > On 12/11/06, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote: > > It seems that your browser treats new lines as under dos/windows. Is > > it Konqueror? > > > > I would suggest you to override the save method of your model, > > replacing new line characters to the preferred format: > > > > class MyModel(models.Model): > > body_text = models.TextField() > > ... > > def save(self): > > self.body_text = self.body_text.replace("\r\n", "\n"). > > self.body_text = self.body_text.replace("\r", "\n"). > > super(MyModel, self).save() > > > > Good luck! > > Aidas Bendoraitis [aka Archatas] > > > > > > > > On 12/10/06, zhongke chen <[EMAIL PROTECTED]> wrote: > > > When I input some text with newline characters in TextField under > > > admin page, I found that the newline character in database is > > > represented as \r\n. My django site is running at linux, other program > > > under linux always treat newline as \n. This cause some compatible > > > problems. How can I change the representation of newline? > > > > > > -- > > > Yours, Zhongke Chen 陈忠克 > > > > > > > > > > > > > > > > > > > > -- > Yours, Zhongke Chen 陈忠克 > > 欢迎访问温州本地Linux论坛:http://groups.google.com/group/linux-wz > > [EMAIL PROTECTED]/excel/ppt文件给我,请先转成PDF格式。谢谢!PLEASE > contact me using [EMAIL PROTECTED] from now on. Other mail boxes > have been deprecated. If you want to attach word/excel/powerpoint > files for me, PLEASE convert them to pdf. Thanks a lot. > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---