|
German language sort sequence (like German phone books) Overview: The ANSI character set - based on English with added non-English characters - doesn’t provide you with a correct German sort sequence as e.g. outlined in the discussion about the WinDev command Upper(..). However, in many cases Tables or Reports built on the alphabetical order of proper names / item names should show the correct sorting sequence! The correct sort sequence in German would be as outlined in http://de.wikipedia.org/wiki/Alphabetische_Sortierung which reveals that German has more than one valid norm for sorting of alphabetical items! See: http://www.student-online.net/Checkliste/14240d05-93ce-4452-bbc1-b97ae991ed9e The country- and case-specific problem is always of how to sort the Umlauts öäü/ÖÄÜ and ß/ss. WinDev sorts German Unicode strings correctly, provided that you chose the correct character set, Language, Country and sub-sort-sequence! a) Analysis: In the analysis, all text fields with a required phone-book like sorting, have to be defined as UNICODE strings! If you have data already in the files, change from ANSI to UNICODE. The restructuring process which is done by WDMODFIC will automatically convert ANSI to UNICODE! Note: A Unicode text string of size 50 will occupy 100 characters in the file! b) The Project code has to be adapted a bit. For all input and display operations, the program has to be instructed to use German character set (Unicode) and sort sequence. Files are to to be created with the correct character set. As an example for our simple phone book application: Nation(nationGerman)ChangeCharset(charsetOccidental,languageGerman,3,0) // <- 3 = country ‘Austria’, sub-sort 0ChangeKeyboard(languageGerman) // Create the filesIF NOT HCreationIfNotFound(PHONE,"","","",hChangeCharset) THEN Info("Es ist nicht möglich, die folgende Datei neu anzulegen oder auf sie zuzugreifen: PHONE",HErrorInfo())IF NOT HCreationIfNotFound(PERSON,"","","",hChangeCharset) THEN Info("Es ist nicht möglich, die folgende Datei neu anzulegen oder auf sie zuzugreifen: PERSON",HErrorInfo())//------------------------ R A D ------------------------ As a demo of the German phone book sort order, I prepared a small project for you. Have a look at Table-search, input of proper names in edit controls, report on Table PERSON etc. Btw, this is an MDI project and has been generated using RAD11. Be aware of the fact that in Unicode character strings each character is represented by 2 bytes and that therefore most string operations will not work as expected! download:GermanPhoneBook (to be supplied soon)
|