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. 2 3507
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.
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.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 wrong?
(Note: I also tried this, unsuccessfully, with Chinese characters:
$out = iconv("gb2312", "utf-8", $in);
)
|
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 string that I tried tweaking without
success. Any help would be much appreciated.
Thanks in advance,
Mark C.
hereinde@yahoo.com
|
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 calculations in which
genetic matrices are saved in text files instead of being held in arrays that
take up memory. I am trying to do something where the genetic matrix is
stored in a text file and I call specfic lines for calculations then put...
|
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 does it not work? I want to get rid of all ' ' and
':' in the string. I've checked the doc and from what I can tell this
is what strip() is supposed to do. Thanks for any help.
|
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()
| |
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 utf-8 and
iso-8859-1 and iconv-ing the string with original xml in it
($isostr=iconv('WINDOWS-1250', 'ISO-8859-1', $winstr);) before xml
parsing did no good (illegal characters, which i could //IGNORE or
//TRANSLIT but then I would loose...
|
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. If omitted or None, the chars
argument defaults to removing
whitespace. The chars argument is not a
|
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 -I/
usr/lpp/application/include
/usr/vacpp/bin/xlC -o test -L/home/jag/progs/lib -L/usr/lib -L/usr/lpp/
application/lib -brtl -s test.o -lapplicationapi -liconv
|
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"
print var.strip(".xml") ### expect to see 'detail', but get 'detai'
var = "overview.xml"
print var.strip(".xml") ### expect and get 'overview'
I have a work around using the replace function which happens to be the
|
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,...
|
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...
| |
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,...
|
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...
|
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...
|
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();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |