private String CharToPN(char c) 
	{
		// binary format of ascii of char c
		String binaryStringShort = Integer.toBinaryString((int)c);
		
		// fill the 0s to get 8 bits
		StringBuffer paddingBuffer = new StringBuffer();
		while(paddingBuffer.length() < 8 - binaryStringShort.length())
		{
			paddingBuffer.append("0");
		}		
		String binaryString = paddingBuffer.toString() + binaryStringShort;
		
		// split into 2 parts and encode each one
		String[] binaryStrings = new String[] {
			binaryString.substring(0, 4),
			binaryString.substring(4, 8)
		};
		
		StringBuffer codewordBuffer = new StringBuffer();
		for (String bits : binaryStrings) 
		{
			// if count #one is odd, check is the same as info, or complement
			String check;
			if(CountOne(bits) % 2 == 1)
			{
				check = bits;
			}
			else
			{
				check = Complement(bits);
			}
			
			// combine info with check
			codewordBuffer.append(bits + check);
		}
		
		return codewordBuffer.toString();
	}