Re: How to change the representation of newline?

2011-12-13 Thread Furbee
Yes, it is hard to determine the question. However, a stab in the dark, you
are trying to get a  tag to display a new line in a django template?
If so, any HTML that you want to render on the display needs to be passed
with the mark_safe() function. For example in views.py

from django.utils.safestring import mark_safe

def helloWorld(request):
message = "Hello  
  World!"
return render_to_response('hello_template.htm', {'message':
mark_safe(message)}, context_instance=RequestContext(request))


hello_template.htm:





Hello, World!
 

 
 {% if message %}
  {{ message }}
 {% endif %}
 


Produces a page like:
Hello
  World!

Without mark_safe(message) page just displays HTML not rendered in plain
text:
  Hello   
 World!

Hope that helps. If you are talking about manipulating characters, see
http://stackoverflow.com/questions/227459/ascii-value-of-a-character-in-python.
You can use ord() and chr() to switch carriage return/line feeds using the
ascii ordinal representation and back if you need to.

Furbee

2011/12/13 Tom Evans 

> 2011/12/13 Germán :
> > Has anybody solved this issue?
> >
> > On Dec 14 2006, 2:47 pm, "Aidas Bendoraitis"
> >  wrote:
> >> I ran out of ideas. :) Maybe somebody else has any thoughts regarding
> new lines?
> >>
> >> Good luck with Django!
> >> Aidas Bendoraitis [aka Archatas]
> >>
> >> On 12/14/06, zhongke chen  wrote:
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> > firefox shows utf-8
> >>
> >> > my firefox is 2.0
> >>
> >> > On 12/14/06, Aidas Bendoraitis  wrote:
> >> > > And what encoding is showed in the page info? ...when you right
> click
> >> > > somewhere in the page and choose "View Page Info" from the menu.
> Maybe
> >> > > just the default character encoding in your firefox settings is set
> >> > > wrongly?
> >>
> >> > > You can always override admin templates copying them into your
> >> > > custom_templates/admin directory.
> >>
> >> > > Regards,
> >> > > Aidas Bendoraitis
> >>
> >> > > On 12/14/06, zhongke chen  wrote:
> >> > > > It's not my html page, but the django admin page.
> >>
> >> > > > the head of admin page is like this:
> >>
> >> > > >  >> > > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;>
> >> > > > http://www.w3.org/1999/xhtml; lang="zh-cn"
> xml:lang="zh-cn" >
> >> > > > 
> >> > > > 站点管理员
> >> > > >  >> > > > href="/oj/adminmedia/css/dashboard.css" />
> >> > > > 
> >>
> >> > > > no encoding here, but lang = 'zh-cn'.
> >>
> >> > > > and all chinese characters in my pages and mysql are encoded in
> UTF-8.
> >> > > > Locale of my server is like this:
> >>
> >> > > > LANG=zh_CN.UTF-8
> >> > > > LANGUAGE=zh_CN:zh:en_US:en
> >> > > > LC_CTYPE="zh_CN.UTF-8"
> >> > > > LC_NUMERIC="zh_CN.UTF-8"
> >> > > > LC_TIME="zh_CN.UTF-8"
> >> > > > LC_COLLATE="zh_CN.UTF-8"
> >> > > > LC_MONETARY="zh_CN.UTF-8"
> >> > > > LC_MESSAGES="zh_CN.UTF-8"
> >> > > > LC_PAPER="zh_CN.UTF-8"
> >> > > > LC_NAME="zh_CN.UTF-8"
> >> > > > LC_ADDRESS="zh_CN.UTF-8"
> >> > > > LC_TELEPHONE="zh_CN.UTF-8"
> >> > > > LC_MEASUREMENT="zh_CN.UTF-8"
> >> > > > LC_IDENTIFICATION="zh_CN.UTF-8"
> >> > > > LC_ALL=
> >>
> >> > > > On 12/13/06, Aidas Bendoraitis 
> wrote:
> >> > > > > 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]
> >>
> >> > > > --
> >> > > > Yours, Zhongke Chen 陈忠克
> >>
> >> > --
> >> > Yours, Zhongke Chen 陈忠克
> >>
> >> > 欢迎访问温州本地Linux论坛:http://groups.google.com/group/linux-wz
> >>
> >> > 请用czk19790...@gmail.com
> 与我联系,本人其它的邮箱已不再使用。如果要发word/excel/ppt文件给我,请先转成PDF格式。谢谢!PLEASE
> >> > contact me using czk19790...@gmail.com 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.
> >
>
> If there is a question in that mass of forwarded emails, I could not
> find it. The most important thing when getting help is to precisely
> and concisely state what your problem is. I'd start from there.
>
> Cheers
>
> Tom
>
> --
> 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
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 

Re: How to change the representation of newline?

2011-12-13 Thread Tom Evans
2011/12/13 Germán :
> Has anybody solved this issue?
>
> On Dec 14 2006, 2:47 pm, "Aidas Bendoraitis"
>  wrote:
>> I ran out of ideas. :) Maybe somebody else has any thoughts regarding new 
>> lines?
>>
>> Good luck with Django!
>> Aidas Bendoraitis [aka Archatas]
>>
>> On 12/14/06, zhongke chen  wrote:
>>
>>
>>
>>
>>
>>
>>
>> > firefox shows utf-8
>>
>> > my firefox is 2.0
>>
>> > On 12/14/06, Aidas Bendoraitis  wrote:
>> > > And what encoding is showed in the page info? ...when you right click
>> > > somewhere in the page and choose "View Page Info" from the menu. Maybe
>> > > just the default character encoding in your firefox settings is set
>> > > wrongly?
>>
>> > > You can always override admin templates copying them into your
>> > > custom_templates/admin directory.
>>
>> > > Regards,
>> > > Aidas Bendoraitis
>>
>> > > On 12/14/06, zhongke chen  wrote:
>> > > > It's not my html page, but the django admin page.
>>
>> > > > the head of admin page is like this:
>>
>> > > > > > > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;>
>> > > > http://www.w3.org/1999/xhtml; lang="zh-cn" 
>> > > > xml:lang="zh-cn" >
>> > > > 
>> > > > 站点管理员
>> > > > > > > > href="/oj/adminmedia/css/dashboard.css" />
>> > > > 
>>
>> > > > no encoding here, but lang = 'zh-cn'.
>>
>> > > > and all chinese characters in my pages and mysql are encoded in UTF-8.
>> > > > Locale of my server is like this:
>>
>> > > > LANG=zh_CN.UTF-8
>> > > > LANGUAGE=zh_CN:zh:en_US:en
>> > > > LC_CTYPE="zh_CN.UTF-8"
>> > > > LC_NUMERIC="zh_CN.UTF-8"
>> > > > LC_TIME="zh_CN.UTF-8"
>> > > > LC_COLLATE="zh_CN.UTF-8"
>> > > > LC_MONETARY="zh_CN.UTF-8"
>> > > > LC_MESSAGES="zh_CN.UTF-8"
>> > > > LC_PAPER="zh_CN.UTF-8"
>> > > > LC_NAME="zh_CN.UTF-8"
>> > > > LC_ADDRESS="zh_CN.UTF-8"
>> > > > LC_TELEPHONE="zh_CN.UTF-8"
>> > > > LC_MEASUREMENT="zh_CN.UTF-8"
>> > > > LC_IDENTIFICATION="zh_CN.UTF-8"
>> > > > LC_ALL=
>>
>> > > > On 12/13/06, Aidas Bendoraitis  wrote:
>> > > > > 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]
>>
>> > > > --
>> > > > Yours, Zhongke Chen 陈忠克
>>
>> > --
>> > Yours, Zhongke Chen 陈忠克
>>
>> > 欢迎访问温州本地Linux论坛:http://groups.google.com/group/linux-wz
>>
>> > 请用czk19790...@gmail.com与我联系,本人其它的邮箱已不再使用。如果要发word/excel/ppt文件给我,请先转成PDF格式。谢谢!PLEASE
>> > contact me using czk19790...@gmail.com 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.
>

If there is a question in that mass of forwarded emails, I could not
find it. The most important thing when getting help is to precisely
and concisely state what your problem is. I'd start from there.

Cheers

Tom

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to change the representation of newline?

2011-12-12 Thread Germán
Has anybody solved this issue?

On Dec 14 2006, 2:47 pm, "Aidas Bendoraitis"
 wrote:
> I ran out of ideas. :) Maybe somebody else has any thoughts regarding new 
> lines?
>
> Good luck with Django!
> Aidas Bendoraitis [aka Archatas]
>
> On 12/14/06, zhongke chen  wrote:
>
>
>
>
>
>
>
> > firefox shows utf-8
>
> > my firefox is 2.0
>
> > On 12/14/06, Aidas Bendoraitis  wrote:
> > > And what encoding is showed in the page info? ...when you right click
> > > somewhere in the page and choose "View Page Info" from the menu. Maybe
> > > just the default character encoding in your firefox settings is set
> > > wrongly?
>
> > > You can always override admin templates copying them into your
> > > custom_templates/admin directory.
>
> > > Regards,
> > > Aidas Bendoraitis
>
> > > On 12/14/06, zhongke chen  wrote:
> > > > It's not my html page, but the django admin page.
>
> > > > the head of admin page is like this:
>
> > > >  > > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;>
> > > > http://www.w3.org/1999/xhtml; lang="zh-cn" 
> > > > xml:lang="zh-cn" >
> > > > 
> > > > 站点管理员
> > > >  > > > href="/oj/adminmedia/css/dashboard.css" />
> > > > 
>
> > > > no encoding here, but lang = 'zh-cn'.
>
> > > > and all chinese characters in my pages and mysql are encoded in UTF-8.
> > > > Locale of my server is like this:
>
> > > > LANG=zh_CN.UTF-8
> > > > LANGUAGE=zh_CN:zh:en_US:en
> > > > LC_CTYPE="zh_CN.UTF-8"
> > > > LC_NUMERIC="zh_CN.UTF-8"
> > > > LC_TIME="zh_CN.UTF-8"
> > > > LC_COLLATE="zh_CN.UTF-8"
> > > > LC_MONETARY="zh_CN.UTF-8"
> > > > LC_MESSAGES="zh_CN.UTF-8"
> > > > LC_PAPER="zh_CN.UTF-8"
> > > > LC_NAME="zh_CN.UTF-8"
> > > > LC_ADDRESS="zh_CN.UTF-8"
> > > > LC_TELEPHONE="zh_CN.UTF-8"
> > > > LC_MEASUREMENT="zh_CN.UTF-8"
> > > > LC_IDENTIFICATION="zh_CN.UTF-8"
> > > > LC_ALL=
>
> > > > On 12/13/06, Aidas Bendoraitis  wrote:
> > > > > 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]
>
> > > > --
> > > > Yours, Zhongke Chen 陈忠克
>
> > --
> > Yours, Zhongke Chen 陈忠克
>
> > 欢迎访问温州本地Linux论坛:http://groups.google.com/group/linux-wz
>
> > 请用czk19790...@gmail.com与我联系,本人其它的邮箱已不再使用。如果要发word/excel/ppt文件给我,请先转成PDF格式。谢谢!PLEASE
> > contact me using czk19790...@gmail.com 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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to change the representation of newline?

2006-12-14 Thread Aidas Bendoraitis
I ran out of ideas. :) Maybe somebody else has any thoughts regarding new lines?

Good luck with Django!
Aidas Bendoraitis [aka Archatas]



On 12/14/06, zhongke chen <[EMAIL PROTECTED]> wrote:
> firefox shows utf-8
>
> my firefox is 2.0
>
> On 12/14/06, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote:
> > And what encoding is showed in the page info? ...when you right click
> > somewhere in the page and choose "View Page Info" from the menu. Maybe
> > just the default character encoding in your firefox settings is set
> > wrongly?
> >
> > You can always override admin templates copying them into your
> > custom_templates/admin directory.
> >
> > Regards,
> > Aidas Bendoraitis
> >
> >
> >
> > On 12/14/06, zhongke chen <[EMAIL PROTECTED]> wrote:
> > > It's not my html page, but the django admin page.
> > >
> > > the head of admin page is like this:
> > >
> > >  > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;>
> > > http://www.w3.org/1999/xhtml; lang="zh-cn" xml:lang="zh-cn" >
> > > 
> > > 站点管理员
> > >  > > href="/oj/adminmedia/css/dashboard.css" />
> > > 
> > >
> > > no encoding here, but lang = 'zh-cn'.
> > >
> > > and all chinese characters in my pages and mysql are encoded in UTF-8.
> > > Locale of my server is like this:
> > >
> > > LANG=zh_CN.UTF-8
> > > LANGUAGE=zh_CN:zh:en_US:en
> > > LC_CTYPE="zh_CN.UTF-8"
> > > LC_NUMERIC="zh_CN.UTF-8"
> > > LC_TIME="zh_CN.UTF-8"
> > > LC_COLLATE="zh_CN.UTF-8"
> > > LC_MONETARY="zh_CN.UTF-8"
> > > LC_MESSAGES="zh_CN.UTF-8"
> > > LC_PAPER="zh_CN.UTF-8"
> > > LC_NAME="zh_CN.UTF-8"
> > > LC_ADDRESS="zh_CN.UTF-8"
> > > LC_TELEPHONE="zh_CN.UTF-8"
> > > LC_MEASUREMENT="zh_CN.UTF-8"
> > > LC_IDENTIFICATION="zh_CN.UTF-8"
> > > LC_ALL=
> > >
> > >
> > > On 12/13/06, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote:
> > > > 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]
> > > >
> > > >
> > >
> > > --
> > > 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
-~--~~~~--~~--~--~---



Re: How to change the representation of newline?

2006-12-14 Thread zhongke chen
firefox shows utf-8

my firefox is 2.0

On 12/14/06, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote:
> And what encoding is showed in the page info? ...when you right click
> somewhere in the page and choose "View Page Info" from the menu. Maybe
> just the default character encoding in your firefox settings is set
> wrongly?
>
> You can always override admin templates copying them into your
> custom_templates/admin directory.
>
> Regards,
> Aidas Bendoraitis
>
>
>
> On 12/14/06, zhongke chen <[EMAIL PROTECTED]> wrote:
> > It's not my html page, but the django admin page.
> >
> > the head of admin page is like this:
> >
> >  > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;>
> > http://www.w3.org/1999/xhtml; lang="zh-cn" xml:lang="zh-cn" >
> > 
> > 站点管理员
> >  > href="/oj/adminmedia/css/dashboard.css" />
> > 
> >
> > no encoding here, but lang = 'zh-cn'.
> >
> > and all chinese characters in my pages and mysql are encoded in UTF-8.
> > Locale of my server is like this:
> >
> > LANG=zh_CN.UTF-8
> > LANGUAGE=zh_CN:zh:en_US:en
> > LC_CTYPE="zh_CN.UTF-8"
> > LC_NUMERIC="zh_CN.UTF-8"
> > LC_TIME="zh_CN.UTF-8"
> > LC_COLLATE="zh_CN.UTF-8"
> > LC_MONETARY="zh_CN.UTF-8"
> > LC_MESSAGES="zh_CN.UTF-8"
> > LC_PAPER="zh_CN.UTF-8"
> > LC_NAME="zh_CN.UTF-8"
> > LC_ADDRESS="zh_CN.UTF-8"
> > LC_TELEPHONE="zh_CN.UTF-8"
> > LC_MEASUREMENT="zh_CN.UTF-8"
> > LC_IDENTIFICATION="zh_CN.UTF-8"
> > LC_ALL=
> >
> >
> > On 12/13/06, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote:
> > > 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]
> > >
> > >
> >
> > --
> > 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
-~--~~~~--~~--~--~---



Re: How to change the representation of newline?

2006-12-14 Thread Aidas Bendoraitis
And what encoding is showed in the page info? ...when you right click
somewhere in the page and choose "View Page Info" from the menu. Maybe
just the default character encoding in your firefox settings is set
wrongly?

You can always override admin templates copying them into your
custom_templates/admin directory.

Regards,
Aidas Bendoraitis



On 12/14/06, zhongke chen <[EMAIL PROTECTED]> wrote:
> It's not my html page, but the django admin page.
>
> the head of admin page is like this:
>
>  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;>
> http://www.w3.org/1999/xhtml; lang="zh-cn" xml:lang="zh-cn" >
> 
> 站点管理员
>  href="/oj/adminmedia/css/dashboard.css" />
> 
>
> no encoding here, but lang = 'zh-cn'.
>
> and all chinese characters in my pages and mysql are encoded in UTF-8.
> Locale of my server is like this:
>
> LANG=zh_CN.UTF-8
> LANGUAGE=zh_CN:zh:en_US:en
> LC_CTYPE="zh_CN.UTF-8"
> LC_NUMERIC="zh_CN.UTF-8"
> LC_TIME="zh_CN.UTF-8"
> LC_COLLATE="zh_CN.UTF-8"
> LC_MONETARY="zh_CN.UTF-8"
> LC_MESSAGES="zh_CN.UTF-8"
> LC_PAPER="zh_CN.UTF-8"
> LC_NAME="zh_CN.UTF-8"
> LC_ADDRESS="zh_CN.UTF-8"
> LC_TELEPHONE="zh_CN.UTF-8"
> LC_MEASUREMENT="zh_CN.UTF-8"
> LC_IDENTIFICATION="zh_CN.UTF-8"
> LC_ALL=
>
>
> On 12/13/06, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote:
> > 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]
> >
> >
>
> --
> Yours, Zhongke Chen 陈忠克
>
> >
>

--~--~-~--~~~---~--~~
 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
-~--~~~~--~~--~--~---



Re: How to change the representation of newline?

2006-12-14 Thread zhongke chen
It's not my html page, but the django admin page.

the head of admin page is like this:

http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;>
http://www.w3.org/1999/xhtml; lang="zh-cn" xml:lang="zh-cn" >

站点管理员



no encoding here, but lang = 'zh-cn'.

and all chinese characters in my pages and mysql are encoded in UTF-8.
Locale of my server is like this:

LANG=zh_CN.UTF-8
LANGUAGE=zh_CN:zh:en_US:en
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"
LC_ALL=


On 12/13/06, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote:
> 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]
>
>

-- 
Yours, Zhongke Chen 陈忠克

--~--~-~--~~~---~--~~
 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
-~--~~~~--~~--~--~---



Re: How to change the representation of newline?

2006-12-13 Thread Aidas Bendoraitis
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
-~--~~~~--~~--~--~---



Re: How to change the representation of newline?

2006-12-13 Thread zhongke chen
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
-~--~~~~--~~--~--~---



Re: How to change the representation of newline?

2006-12-11 Thread Aidas Bendoraitis
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 陈忠克
>
> >
>

--~--~-~--~~~---~--~~
 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
-~--~~~~--~~--~--~---



How to change the representation of newline?

2006-12-09 Thread zhongke chen
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 陈忠克

--~--~-~--~~~---~--~~
 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
-~--~~~~--~~--~--~---