Skip to content

Instantly share code, notes, and snippets.

@jcayzac
jcayzac / widen_ascii.py
Created December 16, 2011 07:48
Python: Convert all ASCII characters to their full-width counterpart
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
WIDE_MAP = dict((i, i + 0xFEE0) for i in xrange(0x21, 0x7F))
WIDE_MAP[0x20] = 0x3000
def widen(s):
"""
Convert all ASCII characters to the full-width counterpart.