Sync euc-kr implementation with spec algorithm