473,397 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Why do i get some acsii chars displayed everytime i use require()?

23
I have been doing PHP sites with a command before the first HMTL headers requiring a 'paging.php' file with no problems at all... by using require() command and is right after the session_start() command, and, of course is in between the <?php ?>. I never had a problem until now. The latest site I'm making is displaying some ascii chars "¡»¿" evertime I use the require() or include() command. And I can't seem to find out what's wrong. I'd appreciate your advises...

REY
Feb 20 '11 #1

✓ answered by Sudaraka

When you are saving as UTF-8, make sure you are saving without the BOM (Byte Order Mask), that's the 3 byte that show up in the browser (Hex EF BB BF).

BOM appear on the browser when you send text from UTF-8 encoded file to the browser but your HTTP header or the HTML META tag instruct the browser to render it as iso-8859-1 or something else, so you could get rid of it by changing the encoding type on those places also.

5 1684
This could be a problem in the encoding type used when saving the .php files.
Check the encoding type using an editor that supports it (i.e. Notepad++ or Geany). Set it to UTF-8 and see if you can fix the problem.
Feb 20 '11 #2
rsbgm
23
Hi Sudaraka,

Thanks for the advise.

It's currently set to UTF-8. Now that you have mentioned that, I tried the other setting but the extra line with the ascii chars are still present in the browser.

I'm still stuck here.

REY
Feb 20 '11 #3
When you are saving as UTF-8, make sure you are saving without the BOM (Byte Order Mask), that's the 3 byte that show up in the browser (Hex EF BB BF).

BOM appear on the browser when you send text from UTF-8 encoded file to the browser but your HTTP header or the HTML META tag instruct the browser to render it as iso-8859-1 or something else, so you could get rid of it by changing the encoding type on those places also.
Feb 20 '11 #4
rsbgm
23
Hi Sudaraka,

That was weird. I thought I have tried both w/ and w/o BOM. I must have missed a certain mixed. But, you are so right! I saved both the index.php and the paging.php file using UTF-8 (w/o BOM) type encoding... and viola! It disappeared!

Thank you very mucho!

REY
Feb 20 '11 #5
Good to hear you got it to work. Glad to help.
Feb 20 '11 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Derek Fountain | last post by:
I was just writing a sanitisation route for a bit of user input. The data is an English text description of a product, and will go into a DB, then back out to other user's browsers. As per...
1
by: phil | last post by:
Using Tkinter to teach high school geometry. Sorta committed to Tkinter at least for now. Would like to use some special chars like limits, infinity, square root, cube root and a buch more. in...
5
by: Dianne Siebold | last post by:
I'm not sure if I can use regex for this or how to do it, but here's what I need to do: I want to check that a string contains only the characters A-Z, a-z, 0-9, -(hypen) or _ (underscore). If...
17
by: Luke Matuszewski | last post by:
Hi ! Simple question (but thus it may appear no simple answer): If i putting a script onto the page i simply could inline it in <script> element or via its src attribute so (second way): <script...
2
by: Viktor Barasov | last post by:
I am running an english Windows 2000. When I use InternetExplorer 6.0 to visit russian pages some of them are displayed correctly while other are not. Why? http://www.spb.ru/ for example is...
40
by: apprentice | last post by:
Hello, I'm writing an class library that I imagine people from different countries might be interested in using, so I'm considering what needs to be provided to support foreign languages,...
1
by: tomtiv | last post by:
Hi All, I am having a probem with asp, xml, com while using chinese chars. The chinese letters come out of com fine and they are also fine when i use asp to write to a text file. When i load...
8
by: Kniffel | last post by:
hi everyone I programm an ISAPI extension with embedded Visual C++ for a Windows CE device. I try to write the network settings to the registry. I am able to write the IpAdress to the registry,...
0
by: kiluone | last post by:
Hi forums, we can't seem to find the answer to this issue. I hope someone can point me in the correct direction. " we are passing text values entered by user to PHP from Flash using XML. But...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.