this one won't work so well though ☹
I tried to use a subshell to try to convert, to make it more robust against invalid utf-8, but that didn't work out
This commit is contained in:
		
							
								
								
									
										11
									
								
								check.t
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								check.t
									
									
									
									
									
								
							| @@ -1,4 +1,4 @@ | ||||
| # $MirOS: src/bin/mksh/check.t,v 1.181 2008/04/20 00:24:25 tg Exp $ | ||||
| # $MirOS: src/bin/mksh/check.t,v 1.182 2008/04/20 00:28:30 tg Exp $ | ||||
| # $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $ | ||||
| # $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $ | ||||
| # $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $ | ||||
| @@ -4822,13 +4822,12 @@ stdin: | ||||
| 		while IFS= read -r line; do | ||||
| 			line=$line$nl | ||||
| 			while [[ -n $line ]]; do | ||||
| 				(( hv = 1#${line::1} & 0xFF )) | ||||
| 				if (( hv < 0xC2 )); then | ||||
| 					n=1 | ||||
| 				elif (( hv < 0xE0 )); then | ||||
| 				if (integer x=1#${line::3}) 2>&-; then | ||||
| 					n=3 | ||||
| 				elif (integer x=1#${line::2}) 2>&-; then | ||||
| 					n=2 | ||||
| 				else | ||||
| 					n=3 | ||||
| 					n=1 | ||||
| 				fi | ||||
| 				wc=1#${line::n} | ||||
| 				if (( (wc < 32) || \ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user