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 2 of 2
  1. #1
    New Coder
    Join Date
    Oct 2002
    Location
    Holy Land
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How can I use UTF-8 to save data ?

    Dear all.

    I want to B able to show more than one language on my web-site,

    my server uses codepage: 1252
    my SQL Server collation is: SQL_Latin1_General_CP1_CI_AS

    So now I'm using utf-8 on my ASP pages and it does show ALL unicode languages,

    I descover ntext type on SQL Server and started using it to store the language texts,

    and I defined my ASP page to run as code page 1252
    @ CODEPAGE="1252"

    and set the meta tag to Unicode (utf-8):
    META http-equiv="Content-Type" content="text/html; charset=utf-8"
    META http-equiv="Content-Language" content="en-us"


    The problem:
    ~~~~~~~~~~~~
    if I try to save data (POST) it does not keep the original characters,

    only if I use charset 1252 (as on my server) it show correctly on the Unicode pages

    META http-equiv="Content-Type" content="text/html; charset=windows-1252"
    META http-equiv="Content-Language" content="en-us"

    so when I save data using the Unicode (utf-8) pages - it does not show well
    ··(Tip): 2 get code from this page - paste it in2 WordPad and then in2 NotePad...
    ··
    ··Best Regards - Yovav Gad
    ··EMail: Dev@GadWorks.com
    ··Web-Site: www.GadWorks.com

  • #2
    New Coder
    Join Date
    Oct 2002
    Location
    Holy Land
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    SOLVED !!!

    Hi me :-)

    I found the problem,

    by using @ CODEPAGE="1252" I did not get the effect I wanted,

    as suggested by MSDN:
    http://msdn.microsoft.com/library/de...om_sesopcp.asp

    I should also use Session.CodePage=1252

    it is now working and my ASP pages (that also uses the utf-8 meta tag) can show Unicode


    P.S.
    one thing I could not figure out is when should I use codepage 65001
    anyway, my ASP files are saved as UTF-8 files with notepad and I did try
    to set both codepage and @codepage on the server to 65001 but it did not work,
    it only worked with codepage 1252 as used on my server and in the DB collation...

    so if U R using codepage 65001 and it is working please let me know what am I missing.
    ··(Tip): 2 get code from this page - paste it in2 WordPad and then in2 NotePad...
    ··
    ··Best Regards - Yovav Gad
    ··EMail: Dev@GadWorks.com
    ··Web-Site: www.GadWorks.com


  •  

    Posting Permissions

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