473,769 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

strtolower with polish sign

Hi everybody;

I can't change polish sign to small letter.

This is my php script:

<?php

setlocale(LC_AL L, "pl_PL.UTF-8") ; //this function return
"pl_PL.UTF-8"
echo strtolower('ӣ TA WODA');

?>

When I have executed my script
the polish letter has still capital.

The result is "ӣta woda" in my firefox.
The letter "TA WODA" change ok i.e "ta woda"
but polish letter no change good i.e. "ӣ" ="ӣ". it has still the
same.

I have tried to use: "header('Conten t-type: text/
html;charset=pl _PL.UTF-8'); " but
result has still the same.

Any sugestion or comment how to corrent change this sign to small
letter I am greatly appreciated.

Robert.

Jul 8 '07 #1
4 3688
On Sun, 08 Jul 2007 03:32:33 -0700, ro************* ***@gmail.com wrote:
>Hi everybody;

I can't change polish sign to small letter.

This is my php script:

<?php

setlocale(LC_AL L, "pl_PL.UTF-8") ; //this function return
"pl_PL.UTF-8"
echo strtolower('?? TA WODA');

?>

When I have executed my script
the polish letter has still capital.

The result is "??ta woda" in my firefox.
The letter "TA WODA" change ok i.e "ta woda"
but polish letter no change good i.e. "??" ="??". it has still the
same.

I have tried to use: "header('Conten t-type: text/
html;charset=p l_PL.UTF-8'); " but
result has still the same.

Any sugestion or comment how to corrent change this sign to small
letter I am greatly appreciated.
It looks like you're trying to use a multi-byte encoded character, in UTF-8.
strtolower and the other core PHP string functions can't handle multibyte, so
it may well be that strlower is changing the case of the string character by
character - which won't work for UTF-8, even if you've set the locale.

You might have more luck with the mbstring functions, like:
http://uk3.php.net/manual/en/function.mb-strtolower.php

Try the following:

<?php
header("Content-type: text/html; charset=utf-8");

setlocale(LC_AL L, "pl_PL.UTF-8");

// UTF-8 encoded Polish characters
$chars = array(
chr(0xC4) . chr(0x85),
chr(0xC4) . chr(0x99),
chr(0xC3) . chr(0xB3),
chr(0xC4) . chr(0x87),
chr(0xC5) . chr(0x82),
);

print "<pre>";

foreach ($chars as $c)
{
print $c;
print " strtoupper: ";
print strtoupper($c);

print " mb_strtoupper: ";
print mb_strtoupper($ c, 'UTF-8');

print "<br>";
}

print "</pre>";
?>

--
Andy Hassall :: an**@andyh.co.u k :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jul 8 '07 #2
On Sun, 08 Jul 2007 03:32:33 -0700, robert.szczepan ski wrote:
Hi everybody;

I can't change polish sign to small letter.

This is my php script:

<?php

setlocale(LC_AL L, "pl_PL.UTF-8") ; //this function return
"pl_PL.UTF-8"
echo strtolower('Ż ŁTA WODA');

?>

When I have executed my script
the polish letter has still capital.

The result is "ŻÓŁta woda" in my firefox. The letter "TA WODA" change
ok i.e "ta woda" but polish letter no change good i.e. "ŻÓŁ" ="ŻÓŁ".
it has still the same.

I have tried to use: "header('Conten t-type: text/
html;charset=pl _PL.UTF-8'); " but
result has still the same.

Any sugestion or comment how to corrent change this sign to small letter
I am greatly appreciated.

Robert.
Have you tried setting locales with "setlocale" function? I don't know
much about Polish, but you should be able to get away with something like
setlocale(LC_AL L,"pl_PL");

--
http://www.mladen-gogala.com
Jul 8 '07 #3
On Sun, 08 Jul 2007 23:46:50 GMT, Mladen Gogala
<mg************ *****@verizon.n etwrote:
>This is my php script:

setlocale(LC_AL L, "pl_PL.UTF-8") ; //this function return
"pl_PL.UTF-8"

Have you tried setting locales with "setlocale" function? I don't know
much about Polish, but you should be able to get away with something like
setlocale(LC_A LL,"pl_PL");
He's already done that...

--
Andy Hassall :: an**@andyh.co.u k :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jul 9 '07 #4
I have tried:

var_dump (setlocale(LC_A LL, "pl_PL")) ; //this function
return: bool(false) - I think it is wrong!!
echo strtolower('ӣ TA WODA'); // it has still display wrond
text

this is my exec locale in ubuntu:

rob@rob-desktop:/var/www/tmp$ locale
LANG=pl_PL.UTF-8
LANGUAGE=pl_PL: pl:en_GB:en
LC_CTYPE="pl_PL .UTF-8"
LC_NUMERIC="pl_ PL.UTF-8"
LC_TIME="pl_PL. UTF-8"
LC_COLLATE="pl_ PL.UTF-8"
LC_MONETARY="pl _PL.UTF-8"
LC_MESSAGES="pl _PL.UTF-8"
LC_PAPER="pl_PL .UTF-8"
LC_NAME="pl_PL. UTF-8"
LC_ADDRESS="pl_ PL.UTF-8"
LC_TELEPHONE="p l_PL.UTF-8"
LC_MEASUREMENT= "pl_PL.UTF-8"
LC_IDENTIFICATI ON="pl_PL.UTF-8"
LC_ALL=
Regard Robert.
Jul 13 '07 #5

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

Similar topics

13
2515
by: Kristof Goossens | last post by:
Hi you guys, in the following insert the strtolower wont put the chars in lowercase. Any ideas what i'm doing wrong? the code: $qryInsRel = "INSERT INTO \"tblrelations\" (rid, vcfirstname, vclastname, vccompany, vcfunction, nlangid, ngenderid, nuserid, ntitleid, dtbirthdate, vcbankaccount, vcvatnr, vctraderegisternr)
7
8801
by: Philip Kofoed | last post by:
Greetings, I have a SQL server 2000 running on an english win2000 workstation. In a database I have a table where one varchar column is set to polish collation. Regional settings for the system is polish. Data entered in a client application looks fine until they are posted. When reading the data with the client application, the special polish characters are incorrect, they appears as e.g. '1' and '3'. The strange thing is that when I...
2
1772
by: Marcin Floryan | last post by:
Hello! How can I create an Installer entirely in Polish language using Deployment Project in VB.NET (I have already translated the available texts into Polish). I have .NET 2003 EN and I read I have to download some addins/components but have got no clue where from? regards
0
3402
by: news.onet.pl | last post by:
How can I generate pdf with polish letters on linux ?? Now it generates double question marks instead of polish letters... Regards, Wojtas
0
2362
by: Larry Neylon | last post by:
Hi there, I'm currently trying to implement a website that will store and retrieve Polish, so I need to be able to handle Polish characters using classic ASP with MySql5. Does anybody have an experience of doing this as I'm banging my head against a brick wall getting this to work using either utf8 or latin2. I can't believe I'm the first person in the world to want to do this! I've input Polish characters directly into the database...
2
5631
by: AmigoFd | last post by:
Hello, This problem is really driving me crazy ... * I have a mySql database which is latin1_swedish_ci * In my web.config I have: <globalization requestEncoding="ISO-8859-2" responseEncoding="ISO-8859-2" fileEncoding="iso-8859-2" culture="pl-PL" uiCulture="pl-PL" />
10
4947
by: Jerim79 | last post by:
I need to take the output from a query and convert it to lower case. Here is the relevant code: $query="SELECT FNAME, LNAME FROM (table) WHERE FNAME=('$FName') AND LNAME=('$LName')"; $result = mysql_query($query) or die('Query failed: ' . mysql_error()); I can get number of rows by using mysql_num_rows($result) so I assume there is some similar method for accessing data in the $result
8
5136
by: Werner Partner | last post by:
I would like to write correct poloish letters, e.g. in the following page: http://www.kairos-team.de/?lang=pl There are such letters as ł, ń, ę, and so on. I found these letter sin polish wikipedia, I looked at the source code, but there is nothing to be seen, what I can do to make these letters. thanks for help
0
1329
by: Piotrekk | last post by:
Hi I have a problem connected with DirectoryInfo class. My paths contain polish characters not present in english alphabet. Problem is that DirectoryInfo class displays them in a very bad way. I have tried to change project properties/ assembly information / neutral language to Polish but it didn't help. I would be grateful for any help.
0
9589
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, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9423
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
10212
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10047
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
8872
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 projectplanning, coding, testing, and deploymentwithout 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
7410
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
5304
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
3962
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
3
2815
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.