Codice: Seleziona tutto
Let ( [
L = Length ( text ) ;
C = Code ( Left ( text ; 1 ) ) ;
Hex = "%" & Div ( C ; 16 ) & Middle ( "0123456789ABCDEF" ; Mod ( C ; 16 ) + 1 ; 1 )
] ;
Case (
C > 126 ; "error" ;
Hex & Case ( L > 1 ; ASCII2Hex ( Right ( text ; L - 1 ) ) )
)
)