Package DE_EPAGES::Core::API::Unicode
Functions to convert Unicode strings to valid URL or file names
@EXPORT_OK |
Functions
CharMapping
Returns a replacement string for characters that are not allowed in URLs or file names.
Syntax |
$ReplaceString = CharMapping($Char) |
Example |
print CharMapping('ö'); # oe |
Input |
|
Return |
|
OrdMapping
Returns a replacement string for selected Unicode characters.
Syntax |
$ReplaceString = OrdMapping($CharCode) |
Example |
print OrdMapping(223); # ss |
Input |
|
Return |
|
Unicode2Alias
Returns an iso1 charset string, which can be used as Alias for objects. Spaces will be replaced by '_' and complex chars to simples.
Syntax |
$Alias = Unicode2Alias($UnicodeString) $Alias = Unicode2Alias($UnicodeString, $AllowedChars) |
Example |
'AAAAAA' eq Unicode2Alias('ÀÁÂÃÄÅ') 'Viele_Koche' eq Unicode2Alias('Viele Köche') 'file_nametxt' eq Unicode2Alias('file name.txt') 'file_name.txt' eq Unicode2Alias('file name.txt', '.') |
Input |
|
Return |
|
Unicode2DirectoryName
Returns a filtered string, which can be used as directory name. Spaces will be replaced by '_', complex chars to simples and all unknown characters to their ordinal number, i.e. '{' is replaced by '_123_'.
Syntax |
$CleanString = Unicode2DirectoryName($UnicodeString) $CleanString = Unicode2DirectoryName($UnicodeString, $AllowedChars) |
Example |
'/asd/Hundchenolgemaldejpg' eq Unicode2DirectoryName('/asd/!#Hündchenölgemälde.jpg') '/a_s_d/!Hundchen_Olgemalde-EEEII_123__125_b.sozdavat' eq Unicode2DirectoryName('/a_s_d/!#Hündchen Ölgemälde-ÉÊËÌÍ#{}(b+).создавать', '!.') |
Input |
|
Return |
|
Unicode2Filename
Returns a filtered string, which can be used as file name. Spaces will be replaced by '_', complex chars to simples and all unknown characters to their ordinal number, i.e. '{' is replaced by '_123_'.
Syntax |
$CleanString = Unicode2Filename($UnicodeString) $CleanString = Unicode2Filename($UnicodeString, $AllowedChars) |
Example |
'asdHundchenolgemalde.jpg' eq Unicode2Filename('/asd/!#Hündchenölgemälde.jpg') 'a_s_d!Hundchen_Olgemalde-EEEII_123__125_b.sozdavat' eq Unicode2Filename('/a_s_d/!#Hündchen Ölgemälde-ÉÊËÌÍ#{}(b+).создавать', '!') |
Input |
|
Return |
|
Unicode2Path
Returns a filtered string, which can be used as directory name. Spaces will be replaced by '_', complex chars to simples and all unknown haracters to their ordinal number, i.e. '{' is replaced by '_123_'.
Syntax |
$CleanString = Unicode2Path($UnicodeString) $CleanString = Unicode2Directory($UnicodeString, $AllowedChars) |
Example |
'/asd/Hundchenolgemaldejpg' eq Unicode2Directory('/asd/!#Hündchenölgemälde.jpg') '/a_s_d/!Hundchen_Olgemalde-EEEII_123__125_b.sozdavat' eq Unicode2Directory('/a_s_d/!#Hündchen Ölgemälde-ÉÊËÌÍ#{}(b+).создавать', '!.') |
Input |
|
Return |
|