dandrake (dandrake) wrote in ljcharm,
dandrake
dandrake
ljcharm

UTF-8 text and Charm

I'm trying to include some Korean into an LJ post, but Charm doesn't want to process it. Here's the traceback:

Traceback (most recent call last):
  File "/home/drake/bin/charm", line 14, in 
    ljcharm.main()
  File "/home/drake/bin/ljcharm.py", line 5623, in main
    jobj.quick_mode(resumeold)
  File "/home/drake/bin/ljcharm.py", line 4833, in quick_mode
    ok = self.cli_postevent()
  File "/home/drake/bin/ljcharm.py", line 1463, in cli_postevent
    Basic_MetaData)
  File "/home/drake/bin/ljcharm.py", line 1282, in client_op
    "auth_response" ], blist)
  File "/home/drake/bin/ljcharm.py", line 1195, in web_encode
    s = utf8_urlencode(pdict)
  File "/home/drake/bin/ljcharm.py", line 359, in utf8_urlencode
    for c in w.encode("UTF-8"):
UnicodeDecodeError: 'ascii' codec can't decode byte 0xec in position 0: ordinal not in range(128)


I've gotten similar errors when cut-and-pasing something from the web that happens to be UTF-8 encoded, like fancy quotation marks and so on. I see that it fails in the function utf8_urlencode, which is odd since my post contains no URLs. Is there a way to fix this?
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your IP address will be recorded 

  • 14 comments