473,388 Members | 1,425 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,388 software developers and data experts.

Problem with Accent and Resource File (bis)

Hello,
(Alain)

Tis is a part of my code to retrieve text from hastable in memory cache, by
reading (befor) a resources file.
Thanks for your help.

/1/ The resources file

* I have create a .TXT file with Keys/Values

Exemple of values :

lblPageLocation=Page d'accueil.
btn002Logoff=Déconnexion
.....

* so, i have generated resources file whith this command :

resgen form.aspx.txt form.aspx.resources
i have got the file : form.aspx.resources

2/ Reading of the resources file.
After the first reading, i set all Keys/Values in a hashtable. The hashtable
is set in cache memore for best performance.

* To use my file, i use ResourceReader Class :
This is a part of my code of my personal Class named MyResxManager

...
Private Shared myRR As ResourceReader = Nothing
....

'Reading of Resource File / Insert into Cache Memory
myRR = New ResourceReader(myKeyFormPath & myKeyFormName)

Dim mydEntry As DictionaryEntry 'Dictionary key-and-value pair that can
set/retrieved
Dim myHT As Hashtable = New Hashtable() 'Initialisation HashTable

'Iterate through the reader, get out the name-value pairs
For Each mydEntry in myRR
myHT.Add(mydEntry.Key,mydEntry.Value)
Next mydEntry

'Close the reader
myRR.Close()
mydEntry=Nothing

'Add to Cache - Relative Expiration & CacheDepency
Dim tspP4TimeOut As System.TimeSpan = New System.TimeSpan(0,0,1,0)
'Objet Timespan = 1 minutes
System.Web.HttpContext.Current.Cache.Insert(KeyFor m, myHT, _
New CacheDependency(myKeyFormPath & myKeyFormName),
System.DateTime.MaxValue, tspP4TimeOut)

'Nothing Hastable
myHT = nothing
3/Reading value from Hastable in memory cache to get the "Text value" of my
control.

In my .aspx page i call my function by passing Name Control and Name
Hashtable.

********** For retrieved text iin code behind.

** COntrol Label Case

lblPageLocation.text =
myLocalization.EasyResourceManager.myGetString("lb lPageLocation","form.aspx")

lblPageLocation = Name of label control
myLocalization = Name of my NameSpace
EasyResourceManager = NAme of my class
myGetString = Name of my public shared function

With a label control i haven't got any problem. The accent is well
displayed.
i get the word : déconnexion

** Control Button Case

btn002Logoff.Text =
myLocalization.EasyResourceManager.myGetString("bt n002Logoff","form.aspx")

Here, all is wrong i get the value :

Déconnexion and not : déconnexion

************** First message

Hello,

I have encountered a deep problem with accent and I don't understand why.
I m preparing a multi-language website. French and English so far.

With french, we have accents and ... problems ;-)
The internationalisation of my website works like that :

- I have created a resources file for a language (french for example) by
using Resgen Command.
- I read the resources file and get the diffrents texts for my controls :
Label, Button, Image ...
Everything works fine but not Text with accent for button control.

I have replaced accent by code as é by é

Example of a resources file :

Control1=FirstText
Control2=SecondText

... and for accent
Control3=Déconnexion

--> é is going to give the sign é

Result :

I have no problem with label control or literal. The right word is dispayed.
But the same variable for a Button control gives me something wrong!

The text displayed for my button is :

Déconnexion and not the text " déconnexion "

By regarding the HTML source i have :

for the Label Control : Déconnexion (is right and displayed "
déconnexion")
for the input control i have value="Déconnexion" ... it's strange !

If someone can help me...
thanks a lot
fabrice
Jan 21 '06 #1
0 1725

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Daedalus.OS | last post by:
Hi, I've been asked to transfert a database from a webhoster to another. I think the database is on a windows box but I'm not 100% shure. The webhoster says it provides combined hosting on...
1
by: Fabrice | last post by:
Hello, I have encountered a deep problem with accent and I don't understand why. I m preparing a multi-language website. French and English so far. With french, we have accents and ......
13
by: rajbala | last post by:
hi all, this is my program ...... By this need to change my port again and again ..... will you help me to proper closing of socket...... code: <%! ServerSocket MyServer; ...
6
by: Oliver Bleckmann | last post by:
hi there, i tried a lot, but it does not work correctly it is more copied to the substr than expected, should be only a "<tag>" but outputs "<tag>etc" shuld parse a xml file like that: <?xml...
4
by: Christofer Dutz | last post by:
Hi, I am having a small problem, that is driving me nuts. My application reads some Xml and runs 2 Xsl Transformations to generate HTML. As soon as my second XSL introduces some <br/tags, the...
0
by: rengaraj | last post by:
Hello, I try to upload a file via ftp while using a proxy-server. My code is giving me the following error even when using: urlc.setDoOutput(true); java.net.ProtocolException: cannot write to...
0
by: nrip | last post by:
Dear All, I am facing a very peculiar problem. I am reading a CSV file from my JSP code and trying to insert them into MYSQL database. the program first reads a line and then splits it into words...
0
by: lovecarole | last post by:
hi, i am the student who should write a program about reading wav file and do the DFT. actually i don't know how to read data of the wav song and save it into the array... if i want to read...
3
by: spasavvas | last post by:
Hi I am trying to create a server – client model where client send a file and when server receive the file send back an ack msg. My code is: import java.net.*; import java.io.*; class...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.