Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    May 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Save a Text File Issues.

    I am trying to save user input to a text file. html or htm ether one would work just as well for me.

    I am running into a problem though with foreign languages being submitted. The page is meant for people to post their ethnic recipes in their language. I can make it work with English and a few other languages but languages that use different characters are not working. I have went back to the basics on this one and still dont know whats going on.

    The man user of the site is a lady who speaks Croatian. When she puts in her recipes in English and follows them with Croatian it will save but loose all of the accent marks from the Croatian text. If she submits just Croatian it still looses the accents.

    I have manually went into the file that it creates and added the text and it shows on the website just fine so I think there must be a problem with how I am saving the information but for the life of me I dont know what else I can use.



    Code:
    <html>
    <body>
    <form action="demo_reqquery.asp" method="get">
    Your name: <input type="text" name="recipe" size="20" />
    <input type="submit" value="Submit" />
    </form>
    <%
    dim recipe
    recipe=Request.QueryString("recipe")
    If recipe<>"" Then
    
    dim fs,f
    set fs=Server.CreateObject("Scripting.FileSystemObject")
    set f=fs.CreateTextFile("c:\recipe.txt",true)
    f.write(recipe)
    f.close
    set f=nothing
    set fs=nothing
    End If
    %>
    </body>
    </html>
    This is the code I am using at this point. I striped to back to a basic setup to get the users information and create a file. The recipe variable has the data. I did a response.write before the f.write to make sure and its showing the accents correctly.

    I thought about trying to just store the data in a database but because its a recipe there would have to be formatting as well and that's throwing me off on that approach.

    Any Help would be great.

    When I open the file though the accents are gone.

  • #2
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,062
    Thanks
    4
    Thanked 8 Times in 8 Posts
    Which character set are you setting in the content type of the form that does the submitting and also on the page that displays the results? I believe that you need to be using UTF-8 but I may be wrong. ( it might be iso-8859-1)


    Placed in the html header
    Code:
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

  • #3
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks @miranda


  •  

    Tags for this Thread

    Posting Permissions

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