473,734 Members | 2,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Converting Case - Umlauts?

I use the following to convert uppercase to lowercase:

translate($quer yString, 'ABCDE...', 'abcde...')

But how can i convert the case for umlauts? öåä etc

Oct 26 '05 #1
10 2862


jo********@gmai l.com wrote:
I use the following to convert uppercase to lowercase:

translate($quer yString, 'ABCDE...', 'abcde...')

But how can i convert the case for umlauts? öåä etc


Pretty much the same, each character in the second argument to translate
is replaced by the character at the same index in the third argument so
you simply need to make sure you have all characters you care about in
upper case as the second argument and the same characters in the same
order as the third argument e.g. global variables

<xsl:variable
name="iso88591U pperCaseLetters "
select="ABCDEFG HIJKLMNOPQRSTUV WXYZÀÁÂÃÄÅÆÇÈÉÊ ËÌÍÎÏÐÑÒÓÔÕÖ×ØÙ ÚÛÜÝ" />
<xsl:variable
name="iso88591L owerCaseLetters "
select="abcdefg hijklmnopqrstuv wxyzàáâãäåæçèéê ëìíîïðñòóôõö×øù úûüý" />

then use e.g.

translate($quer yString, $iso88591UpperC aseLetters,
$iso88591LowerC aseLetters)

--

Martin Honnen
http://JavaScript.FAQTs.com/
Oct 26 '05 #2
This doesnt work, I am using UTF-8.

http://www.jeria.net/XSLT/

type in "ägy" and press submit, you will get a "ablotron error on line
11: XML parser error 4: not well-formed (invalid token)" error.

Xml and xslt files can be found here
http://www.jeria.net/XSLT/xml/

Oct 26 '05 #3
Oh, sorry, it now works, changed to ISO-8859-1

Thanks

Oct 26 '05 #4


Martin Honnen wrote:

<xsl:variable
name="iso88591U pperCaseLetters "
select="ABCDEFG HIJKLMNOPQRSTUV WXYZÀÁÂÃÄÅÆÇÈÉÊ ËÌÍÎÏÐÑÒÓÔÕÖ×ØÙ ÚÛÜÝ" />
<xsl:variable
name="iso88591L owerCaseLetters "
select="abcdefg hijklmnopqrstuv wxyzàáâãäåæçèéê ëìíîïðñòóôõö×øù úûüý" />


Should be

<xsl:variable
name="iso88591U pperCaseLetters "
select="'ABCDEF GHIJKLMNOPQRSTU VWXYZÀÁÂÃÄÅÆÇÈÉ ÊËÌÍÎÏÐÑÒÓÔÕÖ×Ø ÙÚÛÜÝ'" />
<xsl:variable
name="iso88591L owerCaseLetters "
select="'abcdef ghijklmnopqrstu vwxyzàáâãäåæçèé êëìíîïðñòóôõö×ø ùúûüý'" />

of course.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Oct 26 '05 #5
On Wed, 26 Oct 2005, Martin Honnen wrote:
name="iso88591U pperCaseLetters "
select="'ABCDEF GHIJKLMNOPQRSTU VWXYZÀÁÂÃÄÅÆÇÈÉ ÊËÌÍÎÏÐÑÒÓÔÕÖ×Ø ÙÚÛÜÝ'" /> ^ name="iso88591L owerCaseLetters "
select="'abcdef ghijklmnopqrstu vwxyzàáâãäåæçèé êëìíîïðñòóôõö×ø ùúûüý'" />

^

The multiplication sign (×) isn't exactly a letter.
However, "sharp s" and "y with diaeresis" are.

--
Netscape 3.04 does everything I need, and it's utterly reliable.
Why should I switch? Peter T. Daniels in <news:sci.lan g>

Oct 26 '05 #6
On Wed, 26 Oct 2005, Andreas Prilop wrote:
On Wed, 26 Oct 2005, Martin Honnen wrote:
name="iso88591U pperCaseLetters "
select="'ABCDEF GHIJKLMNOPQRSTU VWXYZÀÁÂÃÄÅÆÇÈÉ ÊËÌÍÎÏÐÑÒÓÔÕÖ×Ø ÙÚÛÜÝ'" /> ^
name="iso88591L owerCaseLetters "
select="'abcdef ghijklmnopqrstu vwxyzàáâãäåæçèé êëìíîïðñòóôõö×ø ùúûüý'" />


The multiplication sign (×) isn't exactly a letter.


Granted...
However, "sharp s" and "y with diaeresis" are.


What you going to do with them then, in an iso-8859-1 context? ;-)
Oct 26 '05 #7
On Wed, 26 Oct 2005, Alan J. Flavell wrote:
However, "sharp s" and "y with diaeresis" are.


What you going to do with them then, in an iso-8859-1 context? ;-)


When converting from lower-case to upper-case, "ß" becomes "SS".
"ÿ" might become "Y" without accents in ISO-8859-1.

But this leads me to a more interesting ... err ... case:

In Greek, there are no accents when a word is written in capitals.
For example (I use romanization here):
"Ellás" has an accent on "alpha", whereas
"ELLAS" has no accent on "Alpha".
Therefore "Alpha" might be considered as an upper-case form
of "alpha with tonos".

Even the proper name "Álan" converts to "ALAN" in caps.
Therefore "Alpha" might be considered as an upper-case form
of "Alpha with tonos". Strange? Yes.

I cannot find anything about this in
http://www.unicode.org/Public/UNIDATA/CaseFolding.txt

--
Netscape 3.04 does everything I need, and it's utterly reliable.
Why should I switch? Peter T. Daniels in <news:sci.lan g>

Oct 27 '05 #8
Would it be possible solving this issue using UTF-8? When using UTF-8
these charachters apperas as question marks.

Nov 1 '05 #9


Andreas Prilop wrote:
On Wed, 26 Oct 2005, Martin Honnen wrote:
name="iso88591L owerCaseLetters "
select="'abcdef ghijklmnopqrstu vwxyzàáâãäåæçèé êëìíîïðñòóôõö×ø ùúûüý'" />
^

The multiplication sign (×) isn't exactly a letter.


Right, I was simply to lazy to copy anything by hand from a list of
defined letters and generated those strings programmaticall y from
character codes. For the XPath use with the translate function it does
not matter semantically as long as the second and the third argument
have the same length and that sign × is at the same position in both
arguments, then no conversion/translation happens.
However, "sharp s" and "y with diaeresis" are.


But using XPath 1.0 translate it is only possible to translate one
character into another but not one into a sequence of others so for ß to
SS translatation the suggested approach with translate is not going to work.

I guess I just need to be more careful to name my variables and not have
them reference a standard when the variable use is not quite up to the
standard :).

--

Martin Honnen
http://JavaScript.FAQTs.com/
Nov 1 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
12074
by: Tobias | last post by:
Hi! I had Apache 2.0.47 and PHP 4.3.0 DEV running successfully on a W2k Server. For some reason, I couldn't get PHP to read XML-Attributes with the DOM XML -functions. So I thought, it would be time to update PHP to a newer version. So I simply replaces the old php-files with the new ones and of course kept the php.ini. But now, PHP doesn't work anymore. As soon as I request a page with php code, I get a "document contains no data"...
3
5051
by: Markus Weber | last post by:
Hi, we use htmlMimeMail-2.5.1 (http://www.phpguru.org/mime.mail.html) to send mails. If I send an e-mail with the subject "Das Öl - Öl Öl - Ö Ä Ü ß - test test" I will receive an e-mail with the subject "Das Öl - ÖlÖl - ÖÄÜß - test test". Some spaces have been removed.
0
3267
by: Bjoern Obermeyer | last post by:
Hi, I would like to use a regular expression like "\\w+" to extract the values "red" "green" and "blue" from the expression "red;green;blue". That works fine just until a german umlaut like "ü" is in the expression. Is there a possibility to make the java.util.regex.Matcher work properly with german umlauts? I read something about encoding in the documentation - perhaps I did not try out the right option...
4
4298
by: Joerg Lehmann | last post by:
I am using Python 2.2.3 (Fedora Core 1). The problem is, that strings containing umlauts do not work as I would expect. Here is my example: >>> a = 'äöü' >>> b = '123' >>> print "%-5s %-5s\n%-5s %-5s" % (a,a,b,b) äöü äöü 123 123 I would expect, that the displayed width of a or b is the same: 5 characters.
5
2936
by: F. GEIGER | last post by:
I'm on WinXP, Python 2.3. I don't have problems with umlauts (ä, ö, ü and their uppercase instances) in my wxPython-GUIs, when displayed as static texts. But when filling controls with text containing umlauts, or in the Python console, or when writing to files umlauts are escaped: Python 2.3.4 (#53, May 25 2004, 21:17:02) on win32 Type "help", "copyright", "credits" or "license" for more information.
1
2215
by: Moritz Beller | last post by:
Hello! Given an array of chars such as char array = "Umlauts öäü" (that is definitely able to handle those special characters) a conversion to string returns in getting ripped of the special characters öäü. Obviously, this is something I don't wanna see happen, but otherwise, I don't even have a clue on how to avoid it. Any help urgently required ;-)
2
13097
by: gnv | last post by:
Hi all, I am writing a cross-browser(i.e. 6 and netscape 7.1) javascript program to save an XML file to local file system. I have an xml string like below: var xmlStr = "<?xml version="1.0" encoding="UTF-8"?><a>some info</a>"; I want to save this xml file to local file system with JavaScript,
1
3975
by: Roberto Rocco | last post by:
Hello, I'm using VS 2005 and I need to send a mail body which contains german umlauts (ä,ö,ü). When I receive the mail in Outlook 2003 (english operating system) I always get a '|' or other similar symbols instead of the expected umlaut. I'm using Sstem.Net.Mail and I already tried something like this: string body = "this is some sample äöüÄÖÜß HTML text";
0
1631
by: Nico Grubert | last post by:
Hi there, I wrote a short python script that sends an email using python's email module and I am using Python 2.3.5. The problem is, that umlauts are not displayed properly in some email clients: + On a windows machine running thunderbird 1.0.2 umlauts are displayed properly. The email header contains "Content-type: text/plain; charset=utf-8"
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8776
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9182
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2724
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.