#!/bin/bash

LC_ALL=en_US.UTF-8
pos=$((0x2500))
while true; do
	read header
	if [ "$header" == "" ]; then break; fi
	read a
	read b
	read c
	read d
	read e
	bin="$a$b$c$d$e"
	val=0
	while [ "$bin" != "" ]; do
		val=$((2*val))
		if [ "${bin:0:1}" == "▓" ]; then
			val=$((val+1))
		fi
		bin="${bin:1}"
	done
	if [ $((pos%8)) == 0 ]; then
		printf "/* U+%X */" $pos
	fi
	printf " 0x%06X," $val
	if [ $((pos%8)) == 7 ]; then
		echo
	fi
	pos=$((pos+1))
done < 2500.txt
