Forum Moderators: coopster & phranque

Message Too Old, No Replies

regexp from utf-8 to latin9 - possible?

a character set conversion regexp?

         

claus

12:46 am on Mar 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Actually this is going to be part of a PHP script, but the real topic is regular expressions, so I thought the Perl forum would be more appropriate.

I'm in need of a regular expression to convert a string:

- from UTF-8
- to Latin 9 (ISO-8859-15)

Does anyone know what/how to do? Starting points?

-----
I know some of you may want to advice me to use UTF-8 in stead of Latin, or find this a waste of time, so don't waste your time any further by replying. It is important to me, however odd it may seem to you. Also, please don't tell me about the PHP function "utf8_decode" - you have not read my question if you do.

coopster

2:16 pm on Mar 14, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Will the PHP Multibyte String Functions [php.net] work?

mb_convert_encoding [php.net]

claus

9:22 pm on Mar 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks a lot, I guess these will actually work -- that is, if you can make them work, which I can't.

As far as my reading tells me it requires that you configure PHP to use them as the module is not enabled by default. And I am in no position to configure or reconfigure the server, or even ask someone to do so.

So I'm back to looking for a regexp... any clues?

claus

10:06 pm on Mar 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Uhm... there was an error with the input file -- that was why it didn't work. I feel silly.

Thanks coopster, your tip did the trick!


Jut a thought: Perhaps this thread is better off in the PHP forum now?

coopster

2:36 am on Mar 16, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Glad you got it sorted, claus. Really didn't want to have to think about coming up with a regex ;-) I suppose if you truly needed to though, you might peel apart the source code to see how the developers are running the procedures. That would've been my next step as opposed to reinventing the wheel. However, at this juncture, I'll leave that practice up to somebody else since you have found resolution ;)