473,403 Members | 2,366 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,403 software developers and data experts.

strtolower with polish sign

Hi everybody;

I can't change polish sign to small letter.

This is my php script:

<?php

setlocale(LC_ALL, "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('Content-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 3654
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_ALL, "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('Content-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.
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_ALL, "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.uk :: 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.szczepanski wrote:
Hi everybody;

I can't change polish sign to small letter.

This is my php script:

<?php

setlocale(LC_ALL, "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('Content-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_ALL,"pl_PL");

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

setlocale(LC_ALL, "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_ALL,"pl_PL");
He's already done that...

--
Andy Hassall :: an**@andyh.co.uk :: 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_ALL, "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="pl_PL.UTF-8"
LC_MEASUREMENT="pl_PL.UTF-8"
LC_IDENTIFICATION="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
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,...
7
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...
2
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...
0
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
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...
2
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"...
10
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 =...
8
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...
0
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...
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: 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: 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
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,...
0
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,...
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...
0
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...
0
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...

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.