Upper

WinDev function Upper(Text)

Note: this text discusses some of the peculiar problems with converting German text to upper case and using / not using the function Upper(..). Maybe, this is a help for other languages too ..

What’s the desired result of Upper(..) ? The German characters ä ö ü and ß should be converted to Ä Ö Ü and SZ - that’s the correct conversion in German.
 
The current state of WinDev14 v30f Upper(..) converts ä ö ü to A O and U - because French people do not see a big problem in leaving off the accents. However, ÄÖÜ constitute different vokals from AOU in German. To convert ‘hängen’ to ‘HANGEN’ is impossible too, because the meaning of the two words is very much different!
 
To make things more interesing, the WinDev Edit Control with input mask ‘All Characters in Upper Case’ converts äüö correctly to ÄÜÖ but leaves ß alone. ‘Straße’ would convert to upper case ‘STRAßE’ which looks a bit weird and btw is not correct.
 
Next problem is the sorting sequence. Uppercase words are mostly used for sorting and searching. Both the ASCII and the ANSI sorting sequence put ÄÜÖ and ß after Z, which means that average German / Austrian / Swiss people will not find words starting with ÄÖÜ in a Table or a report easily if it is sorted alphabetically:
ABRAHAM
BERTA
..
ZEPPELIN
ÄHRENGOLD
ÖSTERREICH
ÜBERFUHR
 
Note: there are no words in German starting with ‘ß’
 
The hard way to fix the problem with the ASCII / ANSI sorting sequence would be to use a translation table in order to translate such words to a correctly sorting string, which has to be hidden from the users. For phonebooks this would be the only way to get a printout that conforms to the rules.
 
For applications with less stringent sorting rules, converting to upper case could include a translation to double characters. Native speakers of the German language are used to understand AE as Ä, UE as Ü and OE as Ö. Plus, though the rule says that an upper case ß has to be an SZ, an SS is widely accepted and much better readable than SZ.
 
Below, the function MyUpper(Text) is shown:
 
 
PROCEDURE MyUpper(Text is string)
Text1 is string
L is int = Length(Text)
 
FOR i = 1 TO L
 SWITCH Middle(Text,i,1)
  CASE "a" TO "z"
   Text1 += Charact(Asc(Middle(Text,i,1))-32)
  CASE "ä", "Ä"
   Text1 += "AE"
  CASE "ü", "Ü"
   Text1 += "UE"
  CASE "ö", "Ö"
   Text1 += "OE"
  CASE "ß"
   Text1 += "SS"
  CASE "é"
   Text1 += "É"
  CASE "è"
   Text1 += "È"
  CASE "ç"
   Text1 += "Ç"
  CASE "!","/","(",")","?",",",";",":",".","_","-"
   Text1 += " "
  OTHER CASE
   Text1 += Middle(Text,i,1)
 END
END
RESULT Text1

 

BuiltWithNOF
[Home] [English] [WX Links] [Deutsch] [Impressum] [Downloads] [RADTranslate] [Upper] [NullValues] [TableOnStructure] [HFClassicHFSQL] [RAD11] [USBFind] [Color Contrast] [Dec. Separator] [Setup Problems] [Directories] [Help Authoring] [Access CHM] [Make GUID] [HOpen Files] [Reset Table] [Int. Gen. Number] [TAB-Control] [fDataDir.. commands] [Calendar Weeks] [Input & check EAN 8/13] [Test_for_Dups] [Feiertage] [MemStick as Dongle] [Get Date & Time] [German phone book]