Problems with accented (´and `) letters in notes

Scans for, and displays main/alt relations in your Guild

Moderator: PleegWat

Problems with accented (´and `) letters in notes

Postby Snipes » Thu Jul 13, 2006 3:50 am

Hi there,

we have some members which used an accent for their name. E.g. "Spàrk" who has several alts. I edited the officer_note to "Twink Spàrk" but AltMonitor only recognises "Twink Sp" and does not add the alt to the main.

Anyone else having this problem?
Last edited by Snipes on Mon Jul 31, 2006 4:40 pm, edited 1 time in total.
User avatar
Snipes
WR.net Apprentice
WR.net Apprentice
 
Posts: 20
Joined: Wed Jul 05, 2006 7:22 pm

Problems with accents (´and `) in notes

Postby PleegWat » Thu Jul 13, 2006 1:34 pm

There used to be a point in the wiki on this but I lost that.

There are serveral workarounds, all involving replacing the \w in the regex setting by something else.

  • Use \pL to match all unicode chars defined as letters. This needs php 4.4+ or 5.1+ to work.
  • Change the locale used on your webserver to one that includes accented letters as characters. Most european (non-english) locales should do this.
  • Add the special letters you use after the \w in the regex. This is the most dirty fix.


The first solution is the nicest, but I don't supply it as a default because it requires a higher PHP version than roster does.
Last edited by PleegWat on Mon Jul 31, 2006 4:40 pm, edited 1 time in total.
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm

Problems with accents (´and `) in notes

Postby Striper » Mon Jul 24, 2006 11:42 am

probably worth pointing people to where the \w is :)

you'll find it in the search string in your AltMonitor Config
User avatar
Striper
WR.net Apprentice
WR.net Apprentice
 
Posts: 38
Joined: Tue Jul 04, 2006 7:06 pm
Location: Germany

Re: Problems with accents (´and `) in notes

Postby SeremelaMD » Mon Jul 31, 2006 3:49 pm

Hello,
you do not have fixed (code) for this problem?!

my english and my php is bad :-(((((

I found code on the web page
http://www.php.net/manual/en/reference.pcre.pattern.syntax.php

Although \w and \W do include as "word characters" locale-specific characters (like "�" if you are using the "fr" locale), \b and \B do not work the same way.

For example :
"foo �tait bar" => /\W(�tait)\W/ => This captures correctly "�tait".
"foo �tait bar" => /\b(�tait)\b/ => This fails to capture it.

This is confusing, because the manual talks in both cases about "word characters", but fails to mention the difference in behaviour.



i can not use.
SeremelaMD
WR.net Apprentice
WR.net Apprentice
 
Posts: 1
Joined: Fri Jul 28, 2006 4:31 pm

Problems with accented (´and `) letters in notes

Postby PleegWat » Mon Jul 31, 2006 4:41 pm

Edited my post and the original thread header to be clearer. I can't give a specific fix because there isn't one.
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm

Re: Problems with accents (´and `) in notes

Postby Juzam » Tue Aug 29, 2006 3:39 pm

PleegWat wrote:There used to be a point in the wiki on this but I lost that.

There are serveral workarounds, all involving replacing the \w in the regex setting by something else.

  • Use \pL to match all unicode chars defined as letters. This needs php 4.4+ or 5.1+ to work.
  • Change the locale used on your webserver to one that includes accented letters as characters. Most european (non-english) locales should do this.
  • Add the special letters you use after the \w in the regex. This is the most dirty fix.

The first solution is the nicest, but I don't supply it as a default because it requires a higher PHP version than roster does.


If i put \pL instead of \w i got lot of bad msg ... ^^

And i don't understand what u are talking about for the 2 other case ... :scratch:

I have 4 bad mainless Alt in my roster cause of ^¨éà etc etc ...

http://juzam.dnsdojo.net/addon.php?rost ... AltMonitor

If u have an idea, thanks in advance.
User avatar
Juzam
WR.net Apprentice
WR.net Apprentice
 
Posts: 21
Joined: Wed Aug 09, 2006 10:39 am

Problems with accented (´and `) letters in notes

Postby PleegWat » Tue Aug 29, 2006 9:11 pm

No, the first option won't work for you. You're running PHP 4.3.10, you need PHP 4.4+ or 5.1+
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm

Re: Problems with accented (´and `) letters in notes

Postby dracula » Fri Dec 01, 2006 5:13 pm

I've tried using \pL instead of \w in the regex, but it doesn't have the desired effect...

Let's say I have a main "Péte" and an alt with note "Alt of Péte". The exact regex I'm using is: /Alt of (\pL+)/i
In the update log I see the following:

Péte has main Péte
Péte has no alts
...
Pete has main Pete
Pete has alts
...

So apparently, in the regex-match the accent gets lost and the link between main and alt isn't made. Instead, it shows Pete with a [+] sign, but without childs when clicked on, and Péte as main without alts.

Any suggestions why this isn't working?

Edit: I just tried the less-elegant expression: /Alt of ([^\s]+)/i and this seems to work in this case... :)
Last edited by dracula on Fri Dec 01, 2006 5:28 pm, edited 1 time in total.
dracula
WR.net Apprentice
WR.net Apprentice
 
Posts: 10
Joined: Fri Dec 01, 2006 5:01 pm
Location: The Netherlands

Problems with accented (´and `) letters in notes

Postby PleegWat » Fri Dec 01, 2006 9:48 pm

Your php version probably doesn't support the \pL construction. I can't say what's causing the strange update results though.
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm

Problems with accented (´and `) letters in notes

Postby dracula » Fri Dec 08, 2006 4:59 pm

Well, it recognized all other main-alt relations (the ones without strange symbols in the player note) flawlessly with \pL, so I concluded that my PHP supports it.

But indeed I was wrong there: just checked and indeed it's not running PHP 4.4+ or PHP 5+.
dracula
WR.net Apprentice
WR.net Apprentice
 
Posts: 10
Joined: Fri Dec 01, 2006 5:01 pm
Location: The Netherlands

Re: Problems with accented (´and `) letters in notes

Postby chapi456 » Fri May 11, 2007 4:34 pm

Worked for me with my main : mîm.

Thanks a lot !
chapi456
WR.net Apprentice
WR.net Apprentice
 
Posts: 4
Joined: Tue May 01, 2007 7:22 pm

Re: Problems with accented (´and `) letters in notes

Postby akilerat » Thu Jun 07, 2007 3:53 pm

I had the same problem.
To regulate this problem, I added this line:
Code: Select all
<?php header('Content-type: text/html; charset=UTF-8');?>

to the first line of 'AltMonitor/index.php'
akilerat
WR.net Apprentice
WR.net Apprentice
 
Posts: 1
Joined: Thu Jun 07, 2007 3:43 pm

Re: Problems with accented (´and `) letters in notes

Postby Mack » Tue Mar 16, 2010 7:44 pm

dracula wrote:
Edit: I just tried the less-elegant expression: /Alt of ([^\s]+)/i and this seems to work in this case... :)


This indeed fixed my issue. I had a guildie who had either á or à in his name and in his other cases had both of them in a name.
I was using /([\pL]+)'s Alt/i for my alt code and it would recongnize characters like õ and ë but not the damn a's.
Changing my alt code to /([^\s]+)'s Alt/i worked awesome.
Thanks dracula :glad:
Mack
WR.net Apprentice
WR.net Apprentice
 
Posts: 1
Joined: Mon Feb 15, 2010 10:04 pm


Return to AltMonitor

Who is online

Users browsing this forum: No registered users and 1 guest

cron