SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Evangelist
    Join Date
    Apr 2003
    Location
    lisboa
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    language character

    i'm getting started to mysql/php. (from K. Yank's book)
    I finally got to learn how to retrieve data from mysql, but i got this:
    obriga‡Æo
    What was written in mysql was:
    obrigatório
    First, these strange characters also apeared in mysql, but i went to "my" file and added this:
    "language=portuguese"
    Now, in mysql these characters dont appear anymore. They appear in my web page.
    Do you think the problem lies in mysql or in php configurations?
    What is the solution?
    thanks in advance

  2. #2
    ********* Member website's Avatar
    Join Date
    Oct 2002
    Location
    Iceland
    Posts
    1,238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you are on win computer dos displays the characters differantly, it really doesn't matter since they always show up correctly on the website...
    - website

  3. #3
    SitePoint Evangelist
    Join Date
    Apr 2003
    Location
    lisboa
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    strange characters

    i guess i didnt made myself clear enough.
    Let me try:
    in my language (portuguese), apple writes==maçã.
    If i make an insert (using DOS) in mySQL writting 'maçã', when i use a php script to read the database, in my web page i get: 'ma‡Æ', which is ilegible!!!.
    On the other hand, if i use a php script to store data in the database and in the web page i insert the correct word 'maçã', when i retrieve the data, i can read in a web page the right word 'maçã', but if i go to the DOS window and i read the database, in mySQL the word written for 'maçã' is: 'maþÒ'.
    I tried the following solutions (none resulted)
    1) went to 'my' mySQL file and wrote:
    "language=portuguese"
    2) went to php.ini and and under data handling, wrote:
    default_charset = "iso-8859-1"
    No way...
    How can i overcome this?
    Can anyone help please?

  4. #4
    No. Phil.Roberts's Avatar
    Join Date
    May 2001
    Location
    Nottingham, UK
    Posts
    1,142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You may have to use character intities rather than the actual characters.

    Code:
    #199; = Ç
    Add an ampersand before the # to make it work. vBulletin won't allow me to post it correctly.

  5. #5
    SitePoint Evangelist
    Join Date
    Apr 2003
    Location
    lisboa
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks!
    You mean i should use character entities when?
    a)writing in dos/mySQL,
    or
    b)in php scripts?
    i wonder, is there something like this asp function:
    <%=Server.HtmlEncode("maçã")%>
    in php or in mySQL?

  6. #6
    No. Phil.Roberts's Avatar
    Join Date
    May 2001
    Location
    Nottingham, UK
    Posts
    1,142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •