Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2004-09-01 23:37:58

obeewan
Archived Plugin Author
From: Stockholm, Sweden
Registered: 2004-08-12
Posts: 319
Website

& and # goes bonkers in my plugin

I am doing a plugin that uses regex’s. In it I search for <code>&#</code> but when I upload it to my server instead of thoose two chars I get a nice square (meaning a char that is not in the typeface). I’ve tried different things to get this through but nothing helps. And since it is a regex I can’t add a space or something in between, there need not to be one. When I tried “just to see what happens” if I do add a space inbetween they render fine in the plugin code when it is installed. Argh!

Help!! cried the little plugin developer.

Last edited by obeewan (2004-09-01 23:39:35)


Plugins: ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1

“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu

Offline

#2 2004-09-01 23:45:38

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: & and # goes bonkers in my plugin

Are you editing your plugin via the Textpattern admin interface? It seems to mess up encoding.


Alex

Offline

#3 2004-09-01 23:48:08

obeewan
Archived Plugin Author
From: Stockholm, Sweden
Registered: 2004-08-12
Posts: 319
Website

Re: & and # goes bonkers in my plugin

No, I’ve compiled it and then when I install it outputs (in the admin interface) a square instead of <code>&#</code>.

Last edited by obeewan (2004-09-01 23:49:40)


Plugins: ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1

“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu

Offline

#4 2004-09-01 23:49:14

obeewan
Archived Plugin Author
From: Stockholm, Sweden
Registered: 2004-08-12
Posts: 319
Website

Re: & and # goes bonkers in my plugin

Try this function and encode it and upload it and see what you get:

<code>
function testfunction() { $pattern = “/(&#(\\d+);)/e”;
}
</code>

Because this is what I get:
<code>
$pattern = “/(�(\\d+);)/e”;
</code>

Last edited by obeewan (2004-09-01 23:50:42)


Plugins: ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1

“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu

Offline

#5 2004-09-01 23:59:03

obeewan
Archived Plugin Author
From: Stockholm, Sweden
Registered: 2004-08-12
Posts: 319
Website

Re: & and # goes bonkers in my plugin

Hmmm .. Even if I cut and paste into the admin when I save it goes ape again.


Plugins: ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1

“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu

Offline

#6 2004-09-02 00:01:49

obeewan
Archived Plugin Author
From: Stockholm, Sweden
Registered: 2004-08-12
Posts: 319
Website

Re: & and # goes bonkers in my plugin

Annoying. It works though it looks ape. (Ape is my new fav word it seems ;)


Plugins: ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1

“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu

Offline

Board footer

Powered by FluxBB