func Quote(unsafe string) string {
	safe := make([]byte, 0, len(unsafe)*4)
	for i := 0; i < len(unsafe); i++ {
		b := unsafe[i]
		switch {
		case b >= 'a' && b <= 'z',
			b >= 'A' && b <= 'Z',
			b >= '0' && b <= '9',
			b == '.',
			b == '-':
			safe = append(safe, b)
		default:
			safe = append(safe, fmt.Sprintf("_%02x_", b)...)
		}
	}
	return string(safe)
}
// Quote translates a charm url string into one which can be safely used
// in a file path.  ASCII letters, ASCII digits, dot and dash stay the
// same; other characters are translated to their hex representation
// surrounded by underscores.
Quote translates a charm url string into one which can be safely used
in a file path.  ASCII letters, ASCII digits, dot and dash stay the
same; other characters are translated to their hex representation
surrounded by underscores.
// Quote translates a charm url string into one which can be safely used // in a file path . ASCII letters ASCII digits dot and dash stay the // same ; other characters are translated to their hex representation // surrounded by underscores .
func Quote(unsafe string) string {
	safe := make([]byte, 0, len(unsafe)*4)
	for i := 0; i < len(unsafe); i++ {
		b := unsafe[i]
		switch {
		case b >= 'a' && b <= 'z',
			b >= 'A' && b <= 'Z',
			b >= '0' && b <= '9',
			b == '.',
			b == '-':
			safe = append(safe, b)
		default:
			safe = append(safe, fmt.Sprintf("_%02x_", b)...)
		}
	}
	return string(safe)
}
func Quote ( unsafe string ) string { safe := make ( [ ] byte , 0 , len ( unsafe ) * 4 ) for i := 0 ; i < len ( unsafe ) ; i ++ { b := unsafe [ i ] switch { case b >= 'a' && b <= 'z' , b >= 'A' && b <= 'Z' , b >= '0' && b <= '9' , b == '.' , b == '-' : safe = append ( safe , b ) default : safe = append ( safe , fmt . Sprintf ( " " , b ) ... ) } } return string ( safe ) }
Quote translates a charm url string into one which can be safely used
in a file path.
Quote translates a charm url string into one which can be safely used in a file path .