473,385 Members | 1,769 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,385 software developers and data experts.

iconv to strip out specfic language characters

hello group,

I cannot figure out how to use iconv to "normalize" characters
specific to some language. I need it in file upload where I take a
file from local disc and then save to server and use in web pages, for
example, as img source.

What should be the second parameter of the function?

Say,
iconv('ISO-8859-1', 'ASCII//TRANSLIT', $str);
works but it gives too much transformed result.

I would like just replace specific chars, like "a acute", "a with
macron", "a umlaut", with a character without accent.
Andra.

Apr 24 '07 #1
2 3484
On Apr 24, 2:44 pm, kkadr...@yahoo.com wrote:
hello group,

I cannot figure out how to use iconv to "normalize" characters
specific to some language. I need it in file upload where I take a
file from local disc and then save to server and use in web pages, for
example, as img source.

What should be the second parameter of the function?

Say,
iconv('ISO-8859-1', 'ASCII//TRANSLIT', $str);
works but it gives too much transformed result.

I would like just replace specific chars, like "a acute", "a with
macron", "a umlaut", with a character without accent.

Andra.
Hello Andra,

Try using

iconv('ISO-8859-1', 'ASCII//IGNORE', $str);

instead of

iconv('ISO-8859-1', 'ASCII//TRANSLIT', $str);

You can find more detailed info at http://www.php.net/manual/en/function.iconv.php
(Note the user's comments they are really useful).

Mityok.

Apr 25 '07 #2
thank you,
I will stay now with
$str = iconv('ISO-8859-1', 'ASCII//IGNORE', $str);

Disappointingly that there is not such a function that would convert
language-specific characters to their ascii look-alikes. For me it
does not matter so much that it is not the same and more correct
representation would be specific for each language and so on so on...
I just need filenames to be used without problems and recognizable to
the author.

hello group,

I cannot figure out how to use iconv to "normalize" characters
specific to some language. I need it in file upload where I take a
file from local disc and then save to server and use in web pages, for
example, as img source.

What should be the second parameter of the function?

Say,
iconv('ISO-8859-1', 'ASCII//TRANSLIT', $str);
works but it gives too much transformed result.

I would like just replace specific chars, like "a acute", "a with
macron", "a umlaut", with a character without accent.

Andra.

Hello Andra,

Try using

iconv('ISO-8859-1', 'ASCII//IGNORE', $str);

instead of

iconv('ISO-8859-1', 'ASCII//TRANSLIT', $str);

You can find more detailed info at http://www.php.net/manual/en/function.iconv.php
(Note the user's comments they are really useful).

Mityok.
May 7 '07 #3

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

Similar topics

3
by: pbuchheit | last post by:
I need to convert Japanese characters to UTF-8. I tried using this command on a PHP 5.0.3 server: $out = iconv("iso-2022-jp", "utf-8", $in); But it does not work. Can anyone tell me what I'm doing...
6
by: Mark C | last post by:
All, Is there such a function that can strip all non alpha ( not between a-z) characters from a string? I have a function that I currently use that will strip one character at a time from a...
6
by: Adrian Lin | last post by:
Is there a way to read a specfic line in a text file? For instance if I wanted to just read the 5th line is that possible without having to step through the other lines? Essentially I am doing huge...
5
by: dan.j.weber | last post by:
I'm using Python 2.3.5 and when I type the following in the interactive prompt I see that strip() is not working as advertised: >>>s = 'p p:p' >>>s.strip(' :') 'p p:p' Is this just me or...
1
by: yong | last post by:
I want to use iconv.h to convert some text to another charset. The code is below: ====== #include <stdio.h> #include <stdlib.h> #include <iconv.h> int main()
4
by: B.r.K.o.N.j.A | last post by:
Does anyone has any experience with these two, I've lost a s**tload of time trying to make them work with a well formed xml document encoded in windows-1250 encoding, but simplexml works only with...
3
by: Colin J. Williams | last post by:
The Library Reference has strip( ) Return a copy of the string with the leading and trailing characters removed. The chars argument is a string specifying the set of characters to be removed....
5
by: kp | last post by:
Hi, I am compiling on an AIX 5.1 box and my test machine is AIX 5.3. I run the foll. steps for compiling my test binary "test" /usr/vacpp/bin/xlC test.c -c -o test.o -I/home/jag/progs/include...
4
by: Poppy | last post by:
I'm using versions 2.5.2 and 2.5.1 of python and have encountered a potential bug. Not sure if I'm misunderstanding the usage of the strip function but here's my example. var = "detail.xml"...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.