#!/usr/bin/python
# -*- coding: UTF-8 -*-
def subString(s, length):
us = unicode(s, 'utf-8')
gs = us.encode('gb2312')
n = int(length)
t = gs[:n]
while True:
try:
unicode(t, 'gbk')
break
except:
n -= 1
t = gs[:n]
return t.decode('gb2312')
print subString('中华人民共和国',4)