473,795 Members | 2,766 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Convert on uppercase unaccentent unicode character

JBJ
Hi,
I'am very newbie in Python.
For the moment I'am trying to convert an unicode character to his uppercase
unaccented character.
By example with locale fr_FR:
a,A,à,À should return A
o,O,ô,Ô should return O
½,¼ should return ¼
i,I,î,Î should return I

Have you some suggestions ?

Thank.
Oct 3 '07
12 2609
JBJ wrote:
Steve Holden wrote:
>Duncan Booth wrote:
>>ti******@gmail. com wrote:

On Oct 4, 7:35 am, JBJ <Jean-Bernard.jacquet-at-tele-deux-
point...@inv alid.orgwrote:
Hi,
I'am very newbie in Python.
For the moment I'am trying to convert an unicode character to his
uppercase unaccented character.
By example with locale fr_FR:
a,A,à,À should return A
o,O,ô,Ô should return O
?,? should return ?
i,I,î,Î should return I
>
Have you some suggestions ?
>
Thank.
Unicode strings have an upper() method - try that. I'm think it
should work properly with your locale - it doesn't give the expected
result for me with an english locale.

No, that will uppercase the string, but it doesn't (and shouldn't) strip
the accents:
I can agree that is doesn't (though I am taking your word for it), but a
French person will definitely feel it's doing the wrong thing. Upper
case letters aren't accented in written French.

regards
Steve
http://www.academie-francaise.fr/lan...l#accentuation
Malheureusement , I see that absence of accented capitals is a modern
phenomenon that is regarded as an impediment to the language mostly
stemming from laziness of individual authors and inadequacy of low-end
typesetting software. I hadn't realised I was so up-to-date ;-)

So I will have to stop propagating this misinformation.

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden

Sorry, the dog ate my .sigline so I couldn't cat it

Oct 4 '07 #11
Steve Holden wrote:
Malheureusement , I see that absence of accented capitals is a modern
phenomenon that is regarded as an impediment to the language mostly
stemming from laziness of individual authors and inadequacy of low-end
typesetting software. I hadn't realised I was so up-to-date ;-)

So I will have to stop propagating this misinformation.
Thats really weird, because I was taught in school that caps are not to
be accented. In school! Big Brother is an idiot.

I'm equally ammused by the part of JBJ's link where it says that a
missing acccent "fait hésiter sur la prononciation". Yeah, AS IF written
French had anything to do with the way it is pronounced. Not that I
don't like french, mind you. Everywhere outside action movies its pretty
cool.

/W
Oct 4 '07 #12
Wildemar Wildenburger wrote:
Steve Holden wrote:
>Malheureusemen t, I see that absence of accented capitals is a modern
phenomenon that is regarded as an impediment to the language mostly
stemming from laziness of individual authors and inadequacy of low-end
typesetting software. I hadn't realised I was so up-to-date ;-)

So I will have to stop propagating this misinformation.

Thats really weird, because I was taught in school that caps are not to
be accented. In school! Big Brother is an idiot.

I'm equally ammused by the part of JBJ's link where it says that a
missing acccent "fait hésiter sur la prononciation". Yeah, AS IF written
French had anything to do with the way it is pronounced. Not that I
don't like french, mind you. Everywhere outside action movies its pretty
cool.

/W
Then you never saw Taxi. Or some of Depardieu's ones. Or Les
adventuriers (sp?) (that's a reeeeally old one), or I comme Icarus....
Oct 5 '07 #13

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

Similar topics

23
25955
by: Hallvard B Furuseth | last post by:
Has someone got a Python routine or module which converts Unicode strings to lowercase (or uppercase)? What I actually need to do is to compare a number of strings in a case-insensitive manner, so I assume it's simplest to convert to lower/upper first. Possibly all strings will be from the latin-1 character set, so I could convert to 8-bit latin-1, map to lowercase, and convert back, but that seems rather cumbersome.
30
21873
by: rh0dium | last post by:
Hi All, While I know there is a zillion ways to do this.. What is the most efficient ( in terms of lines of code ) do simply do this. a=1, b=2, c=3 ... z=26 Now if we really want some bonus points.. a=1, b=2, c=3 ... z=26 aa=27 ab=28 etc..
30
8682
by: John Carroll | last post by:
Does anyone have a function or procedure for converting integers to character strings? Thank you, John
8
14333
by: davihigh | last post by:
My Friends: I am using std::ofstream (as well as ifstream), I hope that when i wrote in some std::string(...) with locale, ofstream can convert to UTF-8 encoding and save file to disk. So does ifstream. Something I found shows that, I need to have a proper codecvt to set it. I need more information, maybe a small piece of code sample. Thank you!
8
20350
by: csanjith | last post by:
Hi, i have a situaion where i need to convert the characters entered in an text field to upper case using C. The configuration id utf8 environment in which user can enter any character (single , double, triple byte etc). I need to convert to upper case only those characters which has got upper case. ie if an user enter bot english and japanese characters in the text field, then I should convert only english characters, not japanese.
3
13861
by: GM | last post by:
Dear all, Could you all give me some guide on how to convert my big5 string to unicode using python? I already knew that I might use cjkcodecs or python 2.4 but I still don't have idea on what exactly I should do. Please give me some sample code if you could. Thanks a lot Regards, Gary
0
5070
by: deloford | last post by:
Hi This is going to be a question for anyone who is an expert in C# Text Encoding. My situation is this: I have a Sybase database which is firing back ISO-8559 encoded strings. I am unable to get the db to translate to UTF-8 for non technical reasons. So I have a string coming back with the character œ (ISO value 156). this character appears in .NET as a box character because 156 is not a valid Unicode character value. I have been...
0
571
by: M.-A. Lemburg | last post by:
On 2008-07-01 20:31, Peter Bulychev wrote: You could write a codec which translates Unicode into a ASCII lookalike characters, but AFAIK there is no standard for doing this. I guess the best choice is to use the Unicode code point names as basis. These can be accessed via unicodedata.name(). You can then create a mapping which can be processed by the character map codec.
19
5347
by: est | last post by:
From python manual str( ) Return a string containing a nicely printable representation of an object. For strings, this returns the string itself. The difference with repr(object) is that str(object) does not always attempt to return a string that is acceptable to eval(); its goal is to return a printable string. If no argument is given, returns the empty string, ''.
0
9519
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,...
1
10163
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9040
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6780
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
5436
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
4113
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
3722
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
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.