unicode error sustains

View: New views
2 Messages — Rating Filter:   Alert me  

unicode error sustains

by HimanshuChauhan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hello,
 We,Translation Team again faced the same unicode problem while dumping data in gnowsys.
It doesnt take unicode value for nid.
It does accept the same for status as well as Title.
We tried the following but it didnt work:
1.
    a=u'简体中文'
2.
    a='简体中文'
    a.encode('utf-8')
3.
    a='简体中文'
    a.encode('utf-16')
4.
    unicode('简体中文','latin-1').encode('utf-8')


dict_at_preferred_encoding = {
                'nid':'简体中文',
                'uid':'1',
                'status':'public',
                'content':'',
                'subtypeof':[],
                'title':['HIMANSHU'],
                'description':'',
                'datatype':'varchar',
                'subjecttypes':['po_file']
                }

print context.gnowql.manageAddAttributeType( dict_at_preferred_encoding )
return printed

ERROR

Error Type
ProgrammingError
Error Value
invalid byte sequence for encoding "UTF8": 0xe72fae HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".


Best Regards
Himanshu Chauhan



Forgot the famous last words? Access your message archive online. Click here.
_______________________________________________
Gnowsys-help mailing list
Gnowsys-help@...
http://lists.gnu.org/mailman/listinfo/gnowsys-help

Re: [Gnowsys-dev] unicode error sustains

by Nagarjun G. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Mar 1, 2008 at 11:10 PM, Himanshu Chauhan
<anshu781126@...> wrote:

>
> Hello,
>  We,Translation Team again faced the same unicode problem while dumping data
> in gnowsys.
> It doesnt take unicode value for nid.
> It does accept the same for status as well as Title.
> We tried the following but it didnt work:
> 1.
>     a=u'简体中文'
> 2.
>     a='简体中文'
>     a.encode('utf-8')
> 3.
>     a='简体中文'
>      a.encode('utf-16')
> 4.
>     unicode('简体中文','latin-1').encode('utf-8')
>
>
> dict_at_preferred_encoding = {
>                 'nid':'简体中文',
>                 'uid':'1',
>                 'status':'public',
>                 'content':'',
>                 'subtypeof':[],
>                 'title':['HIMANSHU'],
>                 'description':'',
>                 'datatype':'varchar',
>                 'subjecttypes':['po_file']
>                 }
>
The following link contains lot of help in doing unicode computing in Python.
http://www.amk.ca/python/howto/unicode

does the script containing the unicode has a line that looks like this:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

Nagarjuna

_______________________________________________
Gnowsys-help mailing list
Gnowsys-help@...
http://lists.gnu.org/mailman/listinfo/gnowsys-help