PRPath>>isValidName: and extended characters

Norbert Hartl norbert at hartl.name
Fri Oct 8 22:50:23 MEST 2010


I like to use unicode characters in pier url paths. Nowadays encodeForHTTP changed in pharo and squeak to do utf-8 url-safe-encoding by default. I updated the implementation in the gemstone squeak package to do the same. So principal there is no need to be very restrictive in pier names. 

I did some tests with changing the implementation to 

PRPath>>isValidName: aString
	^ aString isNil not
		and: [ aString isEmpty not
		and: [ aString ~= self parentStructure
		and: [ aString ~= self currentStructure
		and: [ aString allSatisfy: [ :char | char isAlphaNumeric or: [self validCharacters includes: char] ] ] ] ] ]

and it works well. PRPath>>validCharacters: could be reduced to just contain '-._'. Ok, the naming needs probably to be adjusted. But I think it is worth the change.

What do you think?

Norbert




More information about the smallwiki mailing list