/    Sign up×
Community /Pin to ProfileBookmark

Convert to UTF-8

Hi,

I need to convert a string to UTF-8, but I don’t have the iconv functions available on my server.
My string contains accented characters e.g. the letter ‘e’ with an acute accent as in French. I just want to remove any accents e.g. to convert ‘e acute’ into a plain ascii ‘e’.
Any ideas?

Thanks

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@NogDogJun 19.2006 — I'm a bit confused: first you ask how to convert to UTF-8, presumably so that you can utilize the extended character set which it supports, then you ask how to convert an e-acute (which doesn't even require UTF-8, it can be displayed with the standard ASCII character set) into an "e". Perhaps we need some clarification as to exactly what you are trying to accomplish?
Copy linkTweet thisAlerts:
@Black_KnightauthorJun 19.2006 — The file I'm trying to create is for a Froogle data upload, which are required to be UTF-8. All was OK until now, but they have recently made some changes, and it started saying my uploads contained invalid UTF-8 characters -- and was highlighting the accented charcters in my file as invalid. So why should it say these are invalid if e-acutes etc are valid UTF-8?

I have found a function which will convert these to their English counterparts, but perhaps that isn't the problem, I will have to see what happens.
Copy linkTweet thisAlerts:
@NogDogJun 20.2006 — In the upload file, is the e-acute simply that single character, or is it the HTML entity "&eacute" (or "&###;", where ### is the ascii number of the character)? If it's the HTML entity, you could use the html_entity_decode() function to convert it into the single Latin1/UTF-8 character.
×

Success!

Help @Black_Knight spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.30,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...