Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-23-2012, 08:27 PM   PM User | #1
John McSmith
New to the CF scene

 
Join Date: May 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
John McSmith is an unknown quantity at this point
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.
John McSmith is offline   Reply With Quote
Old 06-07-2012, 05:29 PM   PM User | #2
miranda
Senior Coder

 
Join Date: Dec 2002
Location: Arlington, Texas USA
Posts: 1,062
Thanks: 4
Thanked 8 Times in 8 Posts
miranda is an unknown quantity at this point
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">
miranda is offline   Reply With Quote
Old 07-02-2012, 03:32 PM   PM User | #3
callaki
New to the CF scene

 
Join Date: Jul 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
callaki is an unknown quantity at this point
thanks @miranda
callaki is offline   Reply With Quote
Reply

Bookmarks

Tags
asp, language, text

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:19 AM.


Advertisement
Log in to turn off these ads.