<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic ImportError: No module named _codecs_tw, when calling encoding module in an apps script in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/ImportError-No-module-named-codecs-tw-when-calling-encoding/m-p/80306#M1157</link>
    <description>&lt;P&gt;Please help me on this. &lt;/P&gt;

&lt;P&gt;I need to transform encoding from utf-8 to big5 in a app script. However it does nothing with no error shown. Finally I find that's due to lacking some so files in $SPLUNKHOME/lib/python2.6/lib-dynload/, such as _codecs_cn.so, _codecs_hk.so, _codecs_iso2022.so, _codecs_jp.so, _codecs_kr.so, _codecs_tw.so, _multibytecodec*.so.&lt;/P&gt;

&lt;P&gt;A simple test script as following,&lt;BR /&gt;
import sys, time, os, encodings&lt;BR /&gt;
from encodings import big5&lt;BR /&gt;
print encodings.big5.getregentry()&lt;/P&gt;

&lt;P&gt;Run it by,
/opt/splunk/bin/splunk cmd python /opt/splunk/etc/apps/AlertThrottle/bin/a-test.py&lt;BR /&gt;
Then I get ImportError: No module named _codecs_tw.&lt;/P&gt;

&lt;P&gt;I've try to put those missing files from other python package. After that, script shows 'undefined symbol: PyUnicodeUCS4_Splitlines', which seems related to unicodeobject.h file.&lt;/P&gt;

&lt;P&gt;Meanwhile, encoding and decoding of unicod fail too. A script I run as following,&lt;BR /&gt;
Big5txt = unicode(msg[:65],'utf-8').encode('big5')&lt;BR /&gt;
LookupError: unknown encoding: big5&lt;/P&gt;

&lt;P&gt;Is it posible to get those Asian encoding works in python build in splunk?&lt;/P&gt;</description>
    <pubDate>Wed, 13 Apr 2011 10:20:36 GMT</pubDate>
    <dc:creator>lhy719</dc:creator>
    <dc:date>2011-04-13T10:20:36Z</dc:date>
    <item>
      <title>ImportError: No module named _codecs_tw, when calling encoding module in an apps script</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/ImportError-No-module-named-codecs-tw-when-calling-encoding/m-p/80306#M1157</link>
      <description>&lt;P&gt;Please help me on this. &lt;/P&gt;

&lt;P&gt;I need to transform encoding from utf-8 to big5 in a app script. However it does nothing with no error shown. Finally I find that's due to lacking some so files in $SPLUNKHOME/lib/python2.6/lib-dynload/, such as _codecs_cn.so, _codecs_hk.so, _codecs_iso2022.so, _codecs_jp.so, _codecs_kr.so, _codecs_tw.so, _multibytecodec*.so.&lt;/P&gt;

&lt;P&gt;A simple test script as following,&lt;BR /&gt;
import sys, time, os, encodings&lt;BR /&gt;
from encodings import big5&lt;BR /&gt;
print encodings.big5.getregentry()&lt;/P&gt;

&lt;P&gt;Run it by,
/opt/splunk/bin/splunk cmd python /opt/splunk/etc/apps/AlertThrottle/bin/a-test.py&lt;BR /&gt;
Then I get ImportError: No module named _codecs_tw.&lt;/P&gt;

&lt;P&gt;I've try to put those missing files from other python package. After that, script shows 'undefined symbol: PyUnicodeUCS4_Splitlines', which seems related to unicodeobject.h file.&lt;/P&gt;

&lt;P&gt;Meanwhile, encoding and decoding of unicod fail too. A script I run as following,&lt;BR /&gt;
Big5txt = unicode(msg[:65],'utf-8').encode('big5')&lt;BR /&gt;
LookupError: unknown encoding: big5&lt;/P&gt;

&lt;P&gt;Is it posible to get those Asian encoding works in python build in splunk?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2011 10:20:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/ImportError-No-module-named-codecs-tw-when-calling-encoding/m-p/80306#M1157</guid>
      <dc:creator>lhy719</dc:creator>
      <dc:date>2011-04-13T10:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: ImportError: No module named _codecs_tw, when calling encoding module in an apps script</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/ImportError-No-module-named-codecs-tw-when-calling-encoding/m-p/80307#M1158</link>
      <description>&lt;P&gt;我也遇到相同的问题
ImportError: No module named _codecs_cn&lt;/P&gt;

&lt;P&gt;请问你的问题解决了吗?
如果你解决了,可以麻烦你把方法发送到 vipexxe at 126 dot com 吗?
谢谢!!!&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2011 23:35:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/ImportError-No-module-named-codecs-tw-when-calling-encoding/m-p/80307#M1158</guid>
      <dc:creator>vipexxe</dc:creator>
      <dc:date>2011-04-13T23:35:32Z</dc:date>
    </item>
  </channel>
</rss>

