Re: [web2py] Re: rss and unicode

2016-06-21 Thread Kiran Subbaraman

Good to know, this is sorted out.


Kiran Subbaraman
http://subbaraman.wordpress.com/about/

On Tue, 21-06-2016 4:25 PM, Sepehr Mohamadi wrote:

I upgraded my Python to 2.7.11 and the problem solved!

This might be a bug!


On Tuesday, June 21, 2016 at 11:14:56 AM UTC+4:30, Kiran Subbaraman 
wrote:


That's the expected output. And also the code that you executed is
the crux of the rss(feed) encoding code.
So, am not sure why you are still seeing the Error, when you use
serializers.rss()

I do not have a python 2.7.5 environment to try this out. In the
meantime, was taking a look at the release notes of 2.7.6 to see
if this issue existed in 2.7.5:
https://hg.python.org/cpython/raw-file/99d03261c1ba/Misc/NEWS
 .
A cursory browse didn't help me spot anything applicable. You may
also want to take a look.

Other than that, am out of ideas.


Kiran Subbaraman
http://subbaraman.wordpress.com/about/


On Tue, 21-06-2016 11:47 AM, Sepehr Mohamadi wrote:

I get this on Python 2.7 Console:

'Some unicode here
\xd8\xa2\xd8\xb2\xd9\x85\xd8\xa7\xdb\x8c\xd8\xb4
\xd8\xb2\xd8\xa8\xd8\xa7\xd9\x86
\xd9\x81\xd8\xa7\xd8\xb1\xd8\xb3\xdb\x8c'

And you remember the error:

UnicodeDecodeError: 'ascii' codec can't decode byte 0xd8 in
position 18: ordinal not in range(128)

On Tuesday, June 21, 2016 at 10:40:23 AM UTC+4:30, Kiran
Subbaraman wrote:

Weird ... am not aware of 2.7.5 unicode issues. In any case,
if you try just this on your console (ipython / python), what
do you see?

u'Some unicode here آزمایش زبان فارسی'.encode('utf-8', 'replace')



Kiran Subbaraman
http://subbaraman.wordpress.com/about/


On Tue, 21-06-2016 10:46 AM, Sepehr Mohamadi wrote:

Thanks,
I compared your code and mine! I have first line as it is
default in web2py:
# -*- coding: utf-8 -*-
the only difference I understand is that my Python version
is 2.7.5 and yours is 2.7.10
Is that can be a clue?
On Tuesday, June 21, 2016 at 8:52:27 AM UTC+4:30, Kiran
Subbaraman wrote:

This is the code I tried, from within my IDE, and also
from within ipython. My environment: Version
2.14.5-stable+timestamp.2016.04.13.22.22.13, Python
2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32
bit (Intel)] Notice the encoding at the top of the file
- this defines the source code's encoding
(https://www.python.org/dev/peps/pep-0263/
)

# -*- coding: utf-8 -*-

import gluon.serializers as se

feed = {'description': 'my first feed',
 'entries': [{'description': u'Some unicode here آزمایش 
زبان فارسی',
  'link': 'http://feed.example.com',
  'title': 'my feed'}],
 'link': 'http://feed.example.com',
 'title': 'my feed'}

print(se.rss(feed))

*I see this output*:  my
feedhttp://feed.example.com
my first
feedTue, 21 Jun 2016
09:44:28

GMTPyRSS2Gen-1.1.0http://blogs.law.harvard.edu/tech/rssmy
feedhttp://feed.example.com
Some
unicode here آزمایش زبان
فارسیTue, 21 Jun 2016 09:44:28
GMT


Kiran Subbaraman
http://subbaraman.wordpress.com/about/


On Tue, 21-06-2016 1:20 AM, Sepehr Mohamadi wrote:

description=u"Some unicode here آزمایش زبان فارسی"


-- Resources: - http://web2py.com - http://web2py.com/book
(Documentation) - http://github.com/web2py/web2py
 (Source code) -
https://code.google.com/p/web2py/issues/list
 (Report
Issues) --- You received this message because you are
subscribed to the Google Groups "web2py-users" group. To
unsubscribe from this group and stop receiving emails from
it, send an email to web2py+un...@googlegroups.com. For more
options, visit https://groups.google.com/d/optout
. 


-- Resources: - http://web2py.com - http://web2py.com/book
(Documentation) - http://github.com/web2py/web2py

Re: [web2py] Re: rss and unicode

2016-06-21 Thread Sepehr Mohamadi
I upgraded my Python to 2.7.11 and the problem solved!

This might be a bug!


On Tuesday, June 21, 2016 at 11:14:56 AM UTC+4:30, Kiran Subbaraman wrote:
>
> That's the expected output. And also the code that you executed is the 
> crux of the rss(feed) encoding code. 
> So, am not sure why you are still seeing the Error, when you use 
> serializers.rss()
>
> I do not have a python 2.7.5 environment to try this out. In the meantime, 
> was taking a look at the release notes of 2.7.6 to see if this issue 
> existed in 2.7.5: 
> https://hg.python.org/cpython/raw-file/99d03261c1ba/Misc/NEWS . A cursory 
> browse didn't help me spot anything applicable. You may also want to take a 
> look.
>
> Other than that, am out of ideas. 
>
> 
> Kiran Subbaramanhttp://subbaraman.wordpress.com/about/
>
> On Tue, 21-06-2016 11:47 AM, Sepehr Mohamadi wrote:
>
> I get this on Python 2.7 Console:
>
> 'Some unicode here \xd8\xa2\xd8\xb2\xd9\x85\xd8\xa7\xdb\x8c\xd8\xb4 
>> \xd8\xb2\xd8\xa8\xd8\xa7\xd9\x86 \xd9\x81\xd8\xa7\xd8\xb1\xd8\xb3\xdb\x8c'
>
>
> And you remember the error:
>
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xd8 in position 18: 
> ordinal 
>> not in range(128)
>
>
>
>
>
> On Tuesday, June 21, 2016 at 10:40:23 AM UTC+4:30, Kiran Subbaraman wrote: 
>>
>> Weird ... am not aware of 2.7.5 unicode issues.
>> In any case, if you try just this on your console (ipython / python), 
>> what do you see?
>>
>> u'Some unicode here آزمایش زبان فارسی'.encode('utf-8', 'replace')
>>
>>  
>>
>> Kiran Subbaramanhttp://subbaraman.wordpress.com/about/
>>
>> On Tue, 21-06-2016 10:46 AM, Sepehr Mohamadi wrote: 
>>
>> Thanks, 
>> I compared your code and mine! I have first line as it is default in 
>> web2py: 
>>
>> # -*- coding: utf-8 -*-
>>
>> the only difference I understand is that my Python version is 2.7.5 and 
>> yours is 2.7.10
>> Is that can be a clue?
>> On Tuesday, June 21, 2016 at 8:52:27 AM UTC+4:30, Kiran Subbaraman wrote: 
>>>
>>> This is the code I tried, from within my IDE, and also from within 
>>> ipython. My environment: Version 
>>> 2.14.5-stable+timestamp.2016.04.13.22.22.13,  Python 2.7.10 (default, May 
>>> 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)] Notice the encoding at the 
>>> top of the file - this defines the source code's encoding (
>>> https://www.python.org/dev/peps/pep-0263/) 
>>>
>>> # -*- coding: utf-8 -*-
>>>
>>> import gluon.serializers as se
>>>
>>> feed = {'description': 'my first feed',
>>> 'entries': [{'description': u'Some unicode here آزمایش زبان فارسی',
>>>  'link': 'http://feed.example.com',
>>>  'title': 'my feed'}],
>>> 'link': 'http://feed.example.com',
>>> 'title': 'my feed'}
>>>
>>> print(se.rss(feed))
>>>
>>> *I see this output*:  >> version="2.0">my feed
>>> http://feed.example.commy first 
>>> feedTue, 21 Jun 2016 09:44:28 
>>> GMTPyRSS2Gen-1.1.0
>>> http://blogs.law.harvard.edu/tech/rssmy 
>>> feedhttp://feed.example.comSome 
>>> unicode here آزمایش زبان فارسیTue, 21 Jun 2016 
>>> 09:44:28 GMT 
>>>
>>> 
>>> Kiran Subbaramanhttp://subbaraman.wordpress.com/about/
>>>
>>> On Tue, 21-06-2016 1:20 AM, Sepehr Mohamadi wrote: 
>>>
>>> description = u"Some unicode here آزمایش زبان فارسی"
>>>
>>> -- Resources: - http://web2py.com - http://web2py.com/book 
>> (Documentation) - http://github.com/web2py/web2py (Source code) - 
>> https://code.google.com/p/web2py/issues/list (Report Issues) --- You 
>> received this message because you are subscribed to the Google Groups 
>> "web2py-users" group. To unsubscribe from this group and stop receiving 
>> emails from it, send an email to web2py+un...@googlegroups.com. For more 
>> options, visit https://groups.google.com/d/optout. 
>>
>> -- Resources: - http://web2py.com - http://web2py.com/book 
> (Documentation) - http://github.com/web2py/web2py (Source code) - 
> https://code.google.com/p/web2py/issues/list (Report Issues) --- You 
> received this message because you are subscribed to the Google Groups 
> "web2py-users" group. To unsubscribe from this group and stop receiving 
> emails from it, send an email to web2py+un...@googlegroups.com 
> . For more options, visit https://groups.google.com/d/optout. 
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: rss and unicode

2016-06-21 Thread Kiran Subbaraman
That's the expected output. And also the code that you executed is the 
crux of the rss(feed) encoding code.
So, am not sure why you are still seeing the Error, when you use 
serializers.rss()


I do not have a python 2.7.5 environment to try this out. In the 
meantime, was taking a look at the release notes of 2.7.6 to see if this 
issue existed in 2.7.5: 
https://hg.python.org/cpython/raw-file/99d03261c1ba/Misc/NEWS . A 
cursory browse didn't help me spot anything applicable. You may also 
want to take a look.


Other than that, am out of ideas.


Kiran Subbaraman
http://subbaraman.wordpress.com/about/

On Tue, 21-06-2016 11:47 AM, Sepehr Mohamadi wrote:

I get this on Python 2.7 Console:

'Some unicode here
\xd8\xa2\xd8\xb2\xd9\x85\xd8\xa7\xdb\x8c\xd8\xb4
\xd8\xb2\xd8\xa8\xd8\xa7\xd9\x86
\xd9\x81\xd8\xa7\xd8\xb1\xd8\xb3\xdb\x8c'


And you remember the error:

UnicodeDecodeError: 'ascii' codec can't decode byte 0xd8 in
position 18: ordinal not in range(128)





On Tuesday, June 21, 2016 at 10:40:23 AM UTC+4:30, Kiran Subbaraman 
wrote:


Weird ... am not aware of 2.7.5 unicode issues.
In any case, if you try just this on your console (ipython /
python), what do you see?

u'Some unicode here آزمایش زبان فارسی'.encode('utf-8', 'replace')



Kiran Subbaraman
http://subbaraman.wordpress.com/about/


On Tue, 21-06-2016 10:46 AM, Sepehr Mohamadi wrote:

Thanks,
I compared your code and mine! I have first line as it is default
in web2py:
# -*- coding: utf-8 -*-
the only difference I understand is that my Python version is
2.7.5 and yours is 2.7.10
Is that can be a clue?
On Tuesday, June 21, 2016 at 8:52:27 AM UTC+4:30, Kiran
Subbaraman wrote:

This is the code I tried, from within my IDE, and also from
within ipython. My environment: Version
2.14.5-stable+timestamp.2016.04.13.22.22.13, Python 2.7.10
(default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)]
Notice the encoding at the top of the file - this defines the
source code's encoding
(https://www.python.org/dev/peps/pep-0263/
)

# -*- coding: utf-8 -*-

import gluon.serializers as se

feed = {'description': 'my first feed',
 'entries': [{'description': u'Some unicode here آزمایش زبان 
فارسی',
  'link': 'http://feed.example.com',
  'title': 'my feed'}],
 'link': 'http://feed.example.com',
 'title': 'my feed'}

print(se.rss(feed))

*I see this output*: 
my
feedhttp://feed.example.com
my first
feedTue, 21 Jun 2016 09:44:28

GMTPyRSS2Gen-1.1.0http://blogs.law.harvard.edu/tech/rssmy
feedhttp://feed.example.com
Some unicode
here آزمایش زبان فارسیTue, 21 Jun 2016
09:44:28 GMT


Kiran Subbaraman
http://subbaraman.wordpress.com/about/


On Tue, 21-06-2016 1:20 AM, Sepehr Mohamadi wrote:

description=u"Some unicode here آزمایش زبان فارسی"


-- Resources: - http://web2py.com - http://web2py.com/book
(Documentation) - http://github.com/web2py/web2py
 (Source code) -
https://code.google.com/p/web2py/issues/list
 (Report Issues)
--- You received this message because you are subscribed to the
Google Groups "web2py-users" group. To unsubscribe from this
group and stop receiving emails from it, send an email to
web2py+un...@googlegroups.com . For more options,
visit https://groups.google.com/d/optout
. 


-- Resources: - http://web2py.com - http://web2py.com/book 
(Documentation) - http://github.com/web2py/web2py (Source code) - 
https://code.google.com/p/web2py/issues/list (Report Issues) --- You 
received this message because you are subscribed to the Google Groups 
"web2py-users" group. To unsubscribe from this group and stop 
receiving emails from it, send an email to 
web2py+unsubscr...@googlegroups.com 
. For more options, visit 
https://groups.google.com/d/optout. 


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to 

Re: [web2py] Re: rss and unicode

2016-06-21 Thread Sepehr Mohamadi
I get this on Python 2.7 Console:

'Some unicode here \xd8\xa2\xd8\xb2\xd9\x85\xd8\xa7\xdb\x8c\xd8\xb4 
> \xd8\xb2\xd8\xa8\xd8\xa7\xd9\x86 \xd9\x81\xd8\xa7\xd8\xb1\xd8\xb3\xdb\x8c'


And you remember the error:

UnicodeDecodeError: 'ascii' codec can't decode byte 0xd8 in position 18: 
ordinal 
> not in range(128)





On Tuesday, June 21, 2016 at 10:40:23 AM UTC+4:30, Kiran Subbaraman wrote:
>
> Weird ... am not aware of 2.7.5 unicode issues.
> In any case, if you try just this on your console (ipython / python), what 
> do you see?
>
> u'Some unicode here آزمایش زبان فارسی'.encode('utf-8', 'replace')
>
>  
>
> Kiran Subbaramanhttp://subbaraman.wordpress.com/about/
>
> On Tue, 21-06-2016 10:46 AM, Sepehr Mohamadi wrote:
>
> Thanks, 
>
> I compared your code and mine!
>
> I have first line as it is default in web2py:
>
> # -*- coding: utf-8 -*-
>
>
>
> the only difference I understand is that my Python version is 2.7.5 and 
> yours is 2.7.10
>
> Is that can be a clue?
>
>
> On Tuesday, June 21, 2016 at 8:52:27 AM UTC+4:30, Kiran Subbaraman wrote: 
>>
>> This is the code I tried, from within my IDE, and also from within 
>> ipython.
>> My environment: Version 2.14.5-stable+timestamp.2016.04.13.22.22.13,  
>> Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)]
>> Notice the encoding at the top of the file - this defines the source 
>> code's encoding (https://www.python.org/dev/peps/pep-0263/)
>>
>> # -*- coding: utf-8 -*-
>>
>> import gluon.serializers as se
>>
>> feed = {'description': 'my first feed',
>> 'entries': [{'description': u'Some unicode here آزمایش زبان فارسی',
>>  'link': 'http://feed.example.com',
>>  'title': 'my feed'}],
>> 'link': 'http://feed.example.com',
>> 'title': 'my feed'}
>>
>> print(se.rss(feed))
>>
>>
>> *I see this output*:
>> 
>> my feed
>> http://feed.example.commy first 
>> feedTue, 21 Jun 2016 09:44:28 
>> GMTPyRSS2Gen-1.1.0 
>> http://blogs.law.harvard.edu/tech/rssmy
>>  
>> feedhttp://feed.example.comSome 
>> unicode here آزمایش زبان فارسیTue, 21 Jun 2016 
>> 09:44:28 GMT
>>
>>
>>
>> 
>> Kiran Subbaramanhttp://subbaraman.wordpress.com/about/
>>
>> On Tue, 21-06-2016 1:20 AM, Sepehr Mohamadi wrote: 
>>
>> description = u"Some unicode here آزمایش زبان فارسی"
>>
>> -- Resources: - http://web2py.com - http://web2py.com/book 
> (Documentation) - http://github.com/web2py/web2py (Source code) - 
> https://code.google.com/p/web2py/issues/list (Report Issues) --- You 
> received this message because you are subscribed to the Google Groups 
> "web2py-users" group. To unsubscribe from this group and stop receiving 
> emails from it, send an email to web2py+un...@googlegroups.com 
> . For more options, visit https://groups.google.com/d/optout. 
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: rss and unicode

2016-06-21 Thread Kiran Subbaraman

Weird ... am not aware of 2.7.5 unicode issues.
In any case, if you try just this on your console (ipython / python), 
what do you see?


u'Some unicode here آزمایش زبان فارسی'.encode('utf-8', 'replace')



Kiran Subbaraman
http://subbaraman.wordpress.com/about/

On Tue, 21-06-2016 10:46 AM, Sepehr Mohamadi wrote:

Thanks,

I compared your code and mine!

I have first line as it is default in web2py:

# -*- coding: utf-8 -*-


the only difference I understand is that my Python version is 2.7.5 
and yours is 2.7.10


Is that can be a clue?


On Tuesday, June 21, 2016 at 8:52:27 AM UTC+4:30, Kiran Subbaraman wrote:

This is the code I tried, from within my IDE, and also from within
ipython.
My environment: Version
2.14.5-stable+timestamp.2016.04.13.22.22.13, Python 2.7.10
(default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)]
Notice the encoding at the top of the file - this defines the
source code's encoding (https://www.python.org/dev/peps/pep-0263/
)

# -*- coding: utf-8 -*-

import gluon.serializers as se

feed = {'description': 'my first feed',
 'entries': [{'description': u'Some unicode here آزمایش زبان فارسی',
  'link': 'http://feed.example.com',
  'title': 'my feed'}],
 'link': 'http://feed.example.com',
 'title': 'my feed'}

print(se.rss(feed))


*I see this output*:

my
feedhttp://feed.example.com
my first
feedTue, 21 Jun 2016 09:44:28

GMTPyRSS2Gen-1.1.0http://blogs.law.harvard.edu/tech/rss
my
feedhttp://feed.example.com
Some unicode here
آزمایش زبان فارسیTue, 21 Jun 2016 09:44:28
GMT




Kiran Subbaraman
http://subbaraman.wordpress.com/about/


On Tue, 21-06-2016 1:20 AM, Sepehr Mohamadi wrote:

description=u"Some unicode here آزمایش زبان فارسی"


-- Resources: - http://web2py.com - http://web2py.com/book 
(Documentation) - http://github.com/web2py/web2py (Source code) - 
https://code.google.com/p/web2py/issues/list (Report Issues) --- You 
received this message because you are subscribed to the Google Groups 
"web2py-users" group. To unsubscribe from this group and stop 
receiving emails from it, send an email to 
web2py+unsubscr...@googlegroups.com 
. For more options, visit 
https://groups.google.com/d/optout. 


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: rss and unicode

2016-06-20 Thread Sepehr Mohamadi
Thanks,

I compared your code and mine!

I have first line as it is default in web2py:

# -*- coding: utf-8 -*-



the only difference I understand is that my Python version is 2.7.5 and 
yours is 2.7.10

Is that can be a clue?


On Tuesday, June 21, 2016 at 8:52:27 AM UTC+4:30, Kiran Subbaraman wrote:
>
> This is the code I tried, from within my IDE, and also from within ipython.
> My environment: Version 2.14.5-stable+timestamp.2016.04.13.22.22.13,  
> Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)]
> Notice the encoding at the top of the file - this defines the source 
> code's encoding (https://www.python.org/dev/peps/pep-0263/)
>
> # -*- coding: utf-8 -*-
>
> import gluon.serializers as se
>
> feed = {'description': 'my first feed',
> 'entries': [{'description': u'Some unicode here آزمایش زبان فارسی',
>  'link': 'http://feed.example.com',
>  'title': 'my feed'}],
> 'link': 'http://feed.example.com',
> 'title': 'my feed'}
>
> print(se.rss(feed))
>
>
> *I see this output*:
> 
> my feed
> http://feed.example.commy first 
> feedTue, 21 Jun 2016 09:44:28 
> GMTPyRSS2Gen-1.1.0
> http://blogs.law.harvard.edu/tech/rssmy 
> feedhttp://feed.example.comSome unicode 
> here آزمایش زبان فارسیTue, 21 Jun 2016 09:44:28 
> GMT
>
>
>
> 
> Kiran Subbaramanhttp://subbaraman.wordpress.com/about/
>
> On Tue, 21-06-2016 1:20 AM, Sepehr Mohamadi wrote:
>
> description = u"Some unicode here آزمایش زبان فارسی"
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: rss and unicode

2016-06-20 Thread Kiran Subbaraman

This is the code I tried, from within my IDE, and also from within ipython.
My environment: Version 2.14.5-stable+timestamp.2016.04.13.22.22.13,  
Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)]
Notice the encoding at the top of the file - this defines the source 
code's encoding (https://www.python.org/dev/peps/pep-0263/)


# -*- coding: utf-8 -*-

import gluon.serializers as se

feed = {'description': 'my first feed',
'entries': [{'description': u'Some unicode here آزمایش زبان فارسی',
 'link': 'http://feed.example.com',
 'title': 'my feed'}],
'link': 'http://feed.example.com',
'title': 'my feed'}

print(se.rss(feed))


*I see this output*:

my 
feedhttp://feed.example.commy first 
feedTue, 21 Jun 2016 09:44:28 
GMTPyRSS2Gen-1.1.0http://blogs.law.harvard.edu/tech/rssmy 
feedhttp://feed.example.comSome 
unicode here آزمایش زبان فارسیTue, 21 Jun 2016 
09:44:28 GMT





Kiran Subbaraman
http://subbaraman.wordpress.com/about/

On Tue, 21-06-2016 1:20 AM, Sepehr Mohamadi wrote:

description=u"Some unicode here آزمایش زبان فارسی"


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: rss and unicode

2016-06-20 Thread Sepehr Mohamadi
Any Idaes?

On Saturday, June 18, 2016 at 5:52:56 PM UTC+4:30, Sepehr Mohamadi wrote:
>
> 2.14.6-stable+timestamp.2016.05.10.00.21.47
> (Running on Rocket 1.2.6, Python 2.7.5)
>
>
>
> On Saturday, June 18, 2016 at 5:50:44 PM UTC+4:30, Massimo Di Pierro wrote:
>>
>> strange. I do not get any error after adding the u"...". What python 
>> version?
>>
>> On Saturday, 18 June 2016 07:46:50 UTC-5, Sepehr Mohamadi wrote:
>>>
>>> I have tried every thin including that!
>>>
>>> This:
>>>
>>> description = u"Some unicode here آزمایش زبان فارسی"
>>>
>>>
>>> Generates this error:
>>>
>>> UnicodeDecodeError: 'ascii' codec can't decode byte 0xd8 in position 18: 
 ordinal not in range(128)

>>>
>>>
>>> On Saturday, June 18, 2016 at 4:38:29 PM UTC+4:30, Kiran Subbaraman 
>>> wrote:

 Try this - basically mark the content as a unicode string.

 description = u"Some unicode here آزمایش زبان فارسی"

 
 Kiran Subbaramanhttp://subbaraman.wordpress.com/about/

 On Sat, 18-06-2016 1:44 PM, Sepehr Mohamadi wrote:

 Exactly like this:

 Some unicode here   
 ??




 On Saturday, June 18, 2016 at 12:28:48 PM UTC+4:30, Sepehr Mohamadi 
 wrote: 
>
> Hey Guys, 
>
> I have problem using utf-8 codes in rss.
>
> As mentioned in doc:
>
> def feed():
>> return dict(title="my feed",
>> link="http://feed.example.com;,
>> description="my first feed",
>> entries=[dict(title="my feed",
>>   link="http://feed.example.com;,
>>   description="Some unicode here آزمایش زبان 
>> فارسی")
>>  ])
>>
>> When I use unicode in description I receive this in rss: 
>>
>>  
>
>  
> What's wrong!
> Please guide
>
 -- Resources: - http://web2py.com - http://web2py.com/book 
 (Documentation) - http://github.com/web2py/web2py (Source code) - 
 https://code.google.com/p/web2py/issues/list (Report Issues) --- You 
 received this message because you are subscribed to the Google Groups 
 "web2py-users" group. To unsubscribe from this group and stop receiving 
 emails from it, send an email to web2py+un...@googlegroups.com. For 
 more options, visit https://groups.google.com/d/optout. 



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: rss and unicode

2016-06-18 Thread Sepehr Mohamadi
2.14.6-stable+timestamp.2016.05.10.00.21.47
(Running on Rocket 1.2.6, Python 2.7.5)



On Saturday, June 18, 2016 at 5:50:44 PM UTC+4:30, Massimo Di Pierro wrote:
>
> strange. I do not get any error after adding the u"...". What python 
> version?
>
> On Saturday, 18 June 2016 07:46:50 UTC-5, Sepehr Mohamadi wrote:
>>
>> I have tried every thin including that!
>>
>> This:
>>
>> description = u"Some unicode here آزمایش زبان فارسی"
>>
>>
>> Generates this error:
>>
>> UnicodeDecodeError: 'ascii' codec can't decode byte 0xd8 in position 18: 
>> ordinal 
>>> not in range(128)
>>>
>>
>>
>> On Saturday, June 18, 2016 at 4:38:29 PM UTC+4:30, Kiran Subbaraman wrote:
>>>
>>> Try this - basically mark the content as a unicode string.
>>>
>>> description = u"Some unicode here آزمایش زبان فارسی"
>>>
>>> 
>>> Kiran Subbaramanhttp://subbaraman.wordpress.com/about/
>>>
>>> On Sat, 18-06-2016 1:44 PM, Sepehr Mohamadi wrote:
>>>
>>> Exactly like this:
>>>
>>> Some unicode here   
>>> ??
>>>
>>>
>>>
>>>
>>> On Saturday, June 18, 2016 at 12:28:48 PM UTC+4:30, Sepehr Mohamadi 
>>> wrote: 

 Hey Guys, 

 I have problem using utf-8 codes in rss.

 As mentioned in doc:

 def feed():
> return dict(title="my feed",
> link="http://feed.example.com;,
> description="my first feed",
> entries=[dict(title="my feed",
>   link="http://feed.example.com;,
>   description="Some unicode here آزمایش زبان 
> فارسی")
>  ])
>
> When I use unicode in description I receive this in rss: 
>
>  

  
 What's wrong!
 Please guide

>>> -- Resources: - http://web2py.com - http://web2py.com/book 
>>> (Documentation) - http://github.com/web2py/web2py (Source code) - 
>>> https://code.google.com/p/web2py/issues/list (Report Issues) --- You 
>>> received this message because you are subscribed to the Google Groups 
>>> "web2py-users" group. To unsubscribe from this group and stop receiving 
>>> emails from it, send an email to web2py+un...@googlegroups.com. For 
>>> more options, visit https://groups.google.com/d/optout. 
>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: rss and unicode

2016-06-18 Thread Massimo Di Pierro
strange. I do not get any error after adding the u"...". What python 
version?

On Saturday, 18 June 2016 07:46:50 UTC-5, Sepehr Mohamadi wrote:
>
> I have tried every thin including that!
>
> This:
>
> description = u"Some unicode here آزمایش زبان فارسی"
>
>
> Generates this error:
>
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xd8 in position 18: 
> ordinal 
>> not in range(128)
>>
>
>
> On Saturday, June 18, 2016 at 4:38:29 PM UTC+4:30, Kiran Subbaraman wrote:
>>
>> Try this - basically mark the content as a unicode string.
>>
>> description = u"Some unicode here آزمایش زبان فارسی"
>>
>> 
>> Kiran Subbaramanhttp://subbaraman.wordpress.com/about/
>>
>> On Sat, 18-06-2016 1:44 PM, Sepehr Mohamadi wrote:
>>
>> Exactly like this:
>>
>> Some unicode here   ??
>>
>>
>>
>>
>> On Saturday, June 18, 2016 at 12:28:48 PM UTC+4:30, Sepehr Mohamadi 
>> wrote: 
>>>
>>> Hey Guys, 
>>>
>>> I have problem using utf-8 codes in rss.
>>>
>>> As mentioned in doc:
>>>
>>> def feed():
 return dict(title="my feed",
 link="http://feed.example.com;,
 description="my first feed",
 entries=[dict(title="my feed",
   link="http://feed.example.com;,
   description="Some unicode here آزمایش زبان 
 فارسی")
  ])

 When I use unicode in description I receive this in rss: 

  
>>>
>>>  
>>> What's wrong!
>>> Please guide
>>>
>> -- Resources: - http://web2py.com - http://web2py.com/book 
>> (Documentation) - http://github.com/web2py/web2py (Source code) - 
>> https://code.google.com/p/web2py/issues/list (Report Issues) --- You 
>> received this message because you are subscribed to the Google Groups 
>> "web2py-users" group. To unsubscribe from this group and stop receiving 
>> emails from it, send an email to web2py+un...@googlegroups.com. For more 
>> options, visit https://groups.google.com/d/optout. 
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: rss and unicode

2016-06-18 Thread Sepehr Mohamadi
I have tried every thin including that!

This:

description = u"Some unicode here آزمایش زبان فارسی"


Generates this error:

UnicodeDecodeError: 'ascii' codec can't decode byte 0xd8 in position 18: 
ordinal 
> not in range(128)
>


On Saturday, June 18, 2016 at 4:38:29 PM UTC+4:30, Kiran Subbaraman wrote:
>
> Try this - basically mark the content as a unicode string.
>
> description = u"Some unicode here آزمایش زبان فارسی"
>
> 
> Kiran Subbaramanhttp://subbaraman.wordpress.com/about/
>
> On Sat, 18-06-2016 1:44 PM, Sepehr Mohamadi wrote:
>
> Exactly like this:
>
> Some unicode here   ??
>
>
>
>
> On Saturday, June 18, 2016 at 12:28:48 PM UTC+4:30, Sepehr Mohamadi wrote: 
>>
>> Hey Guys, 
>>
>> I have problem using utf-8 codes in rss.
>>
>> As mentioned in doc:
>>
>> def feed():
>>> return dict(title="my feed",
>>> link="http://feed.example.com;,
>>> description="my first feed",
>>> entries=[dict(title="my feed",
>>>   link="http://feed.example.com;,
>>>   description="Some unicode here آزمایش زبان 
>>> فارسی")
>>>  ])
>>>
>>> When I use unicode in description I receive this in rss: 
>>>
>>>  
>>
>>  
>> What's wrong!
>> Please guide
>>
> -- Resources: - http://web2py.com - http://web2py.com/book 
> (Documentation) - http://github.com/web2py/web2py (Source code) - 
> https://code.google.com/p/web2py/issues/list (Report Issues) --- You 
> received this message because you are subscribed to the Google Groups 
> "web2py-users" group. To unsubscribe from this group and stop receiving 
> emails from it, send an email to web2py+un...@googlegroups.com 
> . For more options, visit https://groups.google.com/d/optout. 
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: rss and unicode

2016-06-18 Thread Kiran Subbaraman

Try this - basically mark the content as a unicode string.

description=u"Some unicode here آزمایش زبان فارسی"


Kiran Subbaraman
http://subbaraman.wordpress.com/about/

On Sat, 18-06-2016 1:44 PM, Sepehr Mohamadi wrote:

Exactly like this:

Some unicode here   ??



On Saturday, June 18, 2016 at 12:28:48 PM UTC+4:30, Sepehr Mohamadi 
wrote:


Hey Guys,

I have problem using utf-8 codes in rss.

As mentioned in doc:

def  feed():
 return  dict(title="my feed",
 link="http://feed.example.com;,
 description="my first feed",
 entries=[dict(title="my feed",
   link="http://feed.example.com;,
   description="Some unicode here آزمایش زبان 
فارسی")
  ])

When I use unicode in description I receive this in rss:



What's wrong!
Please guide

-- Resources: - http://web2py.com - http://web2py.com/book 
(Documentation) - http://github.com/web2py/web2py (Source code) - 
https://code.google.com/p/web2py/issues/list (Report Issues) --- You 
received this message because you are subscribed to the Google Groups 
"web2py-users" group. To unsubscribe from this group and stop 
receiving emails from it, send an email to 
web2py+unsubscr...@googlegroups.com 
. For more options, visit 
https://groups.google.com/d/optout. 


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.