473,386 Members | 1,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Converting Case - Umlauts?

I use the following to convert uppercase to lowercase:

translate($queryString, 'ABCDE...', 'abcde...')

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

Oct 26 '05 #1
10 2836


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

translate($queryString, '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="iso88591UpperCaseLetters"
select="ABCDEFGHIJKLMNOPQRSTUVWXYZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ ÐÑÒÓÔÕÖ×ØÙÚÛÜÝ" />
<xsl:variable
name="iso88591LowerCaseLetters"
select="abcdefghijklmnopqrstuvwxyzàáâãäåæçèéêëìíîï ðñòóôõö×øùúûüý" />

then use e.g.

translate($queryString, $iso88591UpperCaseLetters,
$iso88591LowerCaseLetters)

--

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="iso88591UpperCaseLetters"
select="ABCDEFGHIJKLMNOPQRSTUVWXYZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ ÐÑÒÓÔÕÖ×ØÙÚÛÜÝ" />
<xsl:variable
name="iso88591LowerCaseLetters"
select="abcdefghijklmnopqrstuvwxyzàáâãäåæçèéêëìíîï ðñòóôõö×øùúûüý" />


Should be

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

of course.

--

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

^

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.lang>

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


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.lang>

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="iso88591LowerCaseLetters"
select="'abcdefghijklmnopqrstuvwxyzàáâãäåæçèéêëìíî ïðñòóôõö×øùúûüý'" />
^

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 programmatically 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
In <11**********************@g49g2000cwa.googlegroups .com>, on
11/01/2005
at 04:24 AM, jo********@gmail.com said:
Would it be possible solving this issue using UTF-8? When using UTF-8
these charachters apperas as question marks.


Are you sure that you are using the correct octets for UTF-8? If each
character only takes one octet then you're probably storing the data
as ISO-8859-1 or -15, e.g.,

a" ä E4
e" ë EB
i" ï EF
o" ö F6
u" ü FC
A" Ä C4
E" Ë CB
I" Ï CF
O" Ö D6
U" Ü DC

--
Shmuel (Seymour J.) Metz, SysProg and JOAT
<http://patriot.net/~shmuel>

Unsolicited bulk E-mail subject to legal action. I reserve the right
to publicly post or ridicule any abusive E-mail. Reply to domain
Patriot dot net user shmuel+news to contact me. Do not reply to
sp******@library.lspace.org

Nov 1 '05 #11

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

Similar topics

2
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...
3
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...
0
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...
4
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...
5
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...
1
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...
2
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"...
1
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...
0
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...

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.