473,761 Members | 4,739 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

getting data with proper encoding to the finish

Hi,

I have a little problem with encoding. Was hoping maybe anyone can
help me to solve it.

There is some amount of data in a database (PG) that must be inserted
into Excel sheet and emailed. Nothing special, everything works.
Except that non-ascii characters are not displayed properly.
The data is stored as XML into a text field. When I use pgsql it's
displayed good in the terminal. Now I run my script and print data
with "print" statement, still goed. Then I use pyXLWriter to write the
sheet, and Python email package to email it... and the resulting sheet
is not good:

Г is displayed instead of ü (for example)

The most important question that I'd like to ask, is what is the
proper way to debug it?! How can I determine where it goes wrong
(maybe by calculating character code or something?) I know very little
about how encoding works, I use it, but I don't really understand
it... any dummy-proof pointers are also appreciated :)

Thanks...

--
Ksenia
Jul 18 '05 #1
9 3697

Ksenia Marasanova wrote:
Hi,

I have a little problem with encoding. Was hoping maybe anyone can
help me to solve it.

There is some amount of data in a database (PG) that must be inserted
into Excel sheet and emailed. Nothing special, everything works.
Except that non-ascii characters are not displayed properly.
The data is stored as XML into a text field.
This sentence doesn't make much sense. Explain.
When I use pgsql it's
displayed good in the terminal. Now I run my script and print data
with "print" statement, still goed.
Instead of "print data", do "print repr(data)" and show us what you
get. What *you* see on the screen is not much use for diagnosis; it's
the values of the bytes in the file that matter.
Then I use pyXLWriter to write the
sheet,
Open the spreadsheet with Microsoft Excel, copy-and-paste some data to
a Notepad window, save the Notepad file as Unicode type named (say)
"junk.u16" then at the Python interactive prompt do this:

file("junk.u16" , "rb").read().de code("utf16")

and show us what you get.
and Python email package to email it... and the resulting sheet
is not good:
E-mailed how? To whom? [I.e. what country / what cultural background /
on what machine / what operating system / viewed using what software]

Г is displayed instead of ü (for example)


You are saying (in effect) U+0413 (Cyrillic upper case letter GHE) is
displayed instead of U+00FC (Latin small letter U with diaeresis).

OK, we'd already guessed your background from your name :-)

However, what you see isn't necessarily what you've got. How do you
know it's not U+0393 (Greek capital letter GAMMA) or something else
that looks the same? Could even be from a line-drawing set (top left
corner of a box). What you need to do is find out the ordinal of the
character being displayed.

This type of problem arises when a character is written in one encoding
and viewed using another. I've had a quick look through various
likely-suspect 8-bit character sets (e.g. Latin1, KOI-8, cp1251,
cp1252, various DOS (OEM) code-pages) and I couldn't see a pair of
encodings that would reproduce anything like your "umlauted-u becomes
gamma-or-similar" problem. Please supply more than 1 example.

Jul 18 '05 #2
> > There is some amount of data in a database (PG) that must be inserted
into Excel sheet and emailed. Nothing special, everything works.
Except that non-ascii characters are not displayed properly.
The data is stored as XML into a text field.
This sentence doesn't make much sense. Explain.


Sorry, I meant: I use field of the type 'text' in a Postgres table to
store my data. The data is a XML string.
Instead of "print data", do "print repr(data)" and show us what you
get. What *you* see on the screen is not much use for diagnosis; it's
the values of the bytes in the file that matter.
Thanks for this valuable tip. I take letter "é" as an example.

"print repr(data)" shows this:
u'\xe9'

Open the spreadsheet with Microsoft Excel, copy-and-paste some data to
a Notepad window, save the Notepad file as Unicode type named (say)
"junk.u16" then at the Python interactive prompt do this:

file("junk.u16" , "rb").read().de code("utf16")

and show us what you get.
(I am on a Mac so I used Textedit to create a UTF-16 encoded file, right?)
The result from Python is:

u'\u0439'

In Excel sheet it is shown as: й

(Russian again?!)
and Python email package to email it... and the resulting sheet
is not good:
E-mailed how? To whom? [I.e. what country / what cultural background /
on what machine / what operating system / viewed using what software]


Emailed with Python, please see the code at the end of the message.
The receiving system is OS X with languages priority: Dutch, English,
German, Russian and Hebrew. Viewer: MS Office 2004.

You are saying (in effect) U+0413 (Cyrillic upper case letter GHE) is
displayed instead of U+00FC (Latin small letter U with diaeresis).

OK, we'd already guessed your background from your name :-)
:-)
However, what you see isn't necessarily what you've got. How do you
know it's not U+0393 (Greek capital letter GAMMA) or something else
that looks the same? Could even be from a line-drawing set (top left
corner of a box). What you need to do is find out the ordinal of the
character being displayed.

This type of problem arises when a character is written in one encoding
and viewed using another. I've had a quick look through various
likely-suspect 8-bit character sets (e.g. Latin1, KOI-8, cp1251,
cp1252, various DOS (OEM) code-pages) and I couldn't see a pair of
encodings that would reproduce anything like your "umlauted-u becomes
gamma-or-similar" problem. Please supply more than 1 example.


Thank you very much for your help and explanation! The "é" letter is
what I could find till now, see examples above..


The following code fragment is used for creating Excel sheet and sending email:
# ############### ###
# Create Excel sheet
#
f = StringIO()
workbook = xl.Writer(f)
worksheet = workbook.add_wo rksheet()
bold = workbook.add_fo rmat(bold=1)
border = workbook.add_fo rmat(border=1)

worksheet.write _row('A1', ['First Name', 'Last Name'], border)
i = 1
for row in result:
print repr(row['firstname'])
datarow = [row.get('firstn ame'), row.get('surnam e')]
i += 1
worksheet.write _row('A%s' % i, datarow)
workbook.close( )
############### #####
# Create email message

# Create the container (outer) email message.
msg = MIMEMultipart()
# Attach Excel sheet
xls = MIMEBase('appli cation', 'vnd.ms-excel')
xls.set_payload (f.getvalue())
Encoders.encode _base64(xls)
xls.add_header( 'Content-Disposition', 'attachment', filename='some
file name %s-%s-%s.xls' % (today.day, today.month, today.year))
msg.attach(xls)

msg['Subject'] = subject
msg['From'] = fromaddr
msg['To'] = toaddr
# Guarantees the message ends in a newline
msg.epilogue = ''

# Send message
s = smtplib.SMTP(sm tp_host)
s.sendmail(from addr, to_list, msg.as_string() )

--
Ksenia
Jul 18 '05 #3

Ksenia Marasanova wrote:
There is some amount of data in a database (PG) that must be inserted into Excel sheet and emailed. Nothing special, everything works.
Except that non-ascii characters are not displayed properly.
The data is stored as XML into a text field.
This sentence doesn't make much sense. Explain.


Sorry, I meant: I use field of the type 'text' in a Postgres table to
store my data. The data is a XML string.
Instead of "print data", do "print repr(data)" and show us what you
get. What *you* see on the screen is not much use for diagnosis; it's the values of the bytes in the file that matter.


Thanks for this valuable tip. I take letter "é" as an example.

"print repr(data)" shows this:
u'\xe9'

Open the spreadsheet with Microsoft Excel, copy-and-paste some data to a Notepad window, save the Notepad file as Unicode type named (say)
"junk.u16" then at the Python interactive prompt do this:

file("junk.u16" , "rb").read().de code("utf16")

and show us what you get.


(I am on a Mac so I used Textedit to create a UTF-16 encoded file,

right?) The result from Python is:

u'\u0439'
So Unicode U+00E9 has become U+0439? Magic! I suspect that there is a
conversion step or two in there that you haven't mentioned. Are you
talking about the spreadsheet after it is created by your script on the
machine that created it [which is what I asked], or are you talking
about the spreadsheet on the recipient's machine, or are you talking
about the spreadsheet after the recipient has e-mailed it back to you,
hopefully untouched?

In Excel sheet it is shown as: й

(Russian again?!)
This is probably indicative that the Latin-1 e-acute (0xE9) is being
converted to Unicode U+0439 by something that thinks it is actually in
an 8-bit Cyrillic encoding (0xE9 is "Cyrillic small letter short I" in
some 8-bit encodings) but the u-umlaut becoming GHE example doesn't fit
this story.

Please do a test where you put several different accented Latin letters
in the one field in your database. No, put ALL the non-ASCII characters
that you expect to be transmitted unchanged into test fields -- this
will make you think about what language(s)/locale(s) your database is
designed for and what language(s)/locale(s) your e-mail targets use.
Having this test data will be useful in the future for verifying that
your system works. Repeat all the above steps. Tell us what you see in
Excel on your machine and on the recipient's machine.
and Python email package to email it... and the resulting sheet
is not good:
E-mailed how? To whom? [I.e. what country / what cultural background / on what machine / what operating system / viewed using what software]
Emailed with Python, please see the code at the end of the message.
The receiving system is OS X with languages priority: Dutch, English, German, Russian and Hebrew. Viewer: MS Office 2004.
Sending system is ...?

You are saying (in effect) U+0413 (Cyrillic upper case letter GHE)
is displayed instead of U+00FC (Latin small letter U with diaeresis).

OK, we'd already guessed your background from your name :-)


:-)

However, what you see isn't necessarily what you've got. How do you
know it's not U+0393 (Greek capital letter GAMMA) or something else
that looks the same? Could even be from a line-drawing set (top left corner of a box). What you need to do is find out the ordinal of the character being displayed.

This type of problem arises when a character is written in one encoding and viewed using another. I've had a quick look through various
likely-suspect 8-bit character sets (e.g. Latin1, KOI-8, cp1251,
cp1252, various DOS (OEM) code-pages) and I couldn't see a pair of
encodings that would reproduce anything like your "umlauted-u becomes gamma-or-similar" problem. Please supply more than 1 example.


Thank you very much for your help and explanation! The "é" letter is
what I could find till now, see examples above..


The following code fragment is used for creating Excel sheet and

sending email: # ############### ###
# Create Excel sheet
#
f = StringIO()
workbook = xl.Writer(f)
worksheet = workbook.add_wo rksheet()
bold = workbook.add_fo rmat(bold=1)
border = workbook.add_fo rmat(border=1)

worksheet.write _row('A1', ['First Name', 'Last Name'], border)
i = 1
for row in result:
print repr(row['firstname'])
datarow = [row.get('firstn ame'), row.get('surnam e')]
You print the repr() of row['firstname'] but pass row.get('firstn ame')
to the XLS writer -- do they have the same value? For believability,
print what you pass!!
i += 1
worksheet.write _row('A%s' % i, datarow)
Check the documentation for the XLS writer module to see if it is doing
an implicit conversion here.
workbook.close( )
############### #####
# Create email message

# Create the container (outer) email message.
msg = MIMEMultipart()
# Attach Excel sheet
xls = MIMEBase('appli cation', 'vnd.ms-excel')
xls.set_payload (f.getvalue())
Encoders.encode _base64(xls)
xls.add_header( 'Content-Disposition', 'attachment', filename='some
file name %s-%s-%s.xls' % (today.day, today.month, today.year))
msg.attach(xls)

msg['Subject'] = subject
msg['From'] = fromaddr
msg['To'] = toaddr
# Guarantees the message ends in a newline
msg.epilogue = ''

# Send message
s = smtplib.SMTP(sm tp_host)
s.sendmail(from addr, to_list, msg.as_string() )

--
Ksenia


Jul 18 '05 #4

Ksenia Marasanova wrote:
Sorry, I meant: I use field of the type 'text' in a Postgres table to
store my data. The data is a XML string.
Instead of "print data", do "print repr(data)" and show us what you
get. What *you* see on the screen is not much use for diagnosis; it's the values of the bytes in the file that matter.


Thanks for this valuable tip. I take letter "" as an example.

"print repr(data)" shows this:
u'\xe9'


That doesn't look like an "XML string" to me. Show the WHOLE contents
of the field.

Have you read the docs of the Perl module of which pyXLWrtiter is a
docs-free port? Right down the end it mutters something about XML
parsers returning UTF8 which will jam up the works if fed into an Excel
spreadsheet ...

Jul 18 '05 #5
John Machin wrote:
Ksenia Marasanova wrote:
Sorry, I meant: I use field of the type 'text' in a Postgres table to
store my data. The data is a XML string.
Instead of "print data", do "print repr(data)" and show us what you
get. What *you* see on the screen is not much use for diagnosis;
it's the values of the bytes in the file that matter.


Thanks for this valuable tip. I take letter "" as an example.

"print repr(data)" shows this:
u'\xe9'


That doesn't look like an "XML string" to me. Show the WHOLE contents
of the field.

Have you read the docs of the Perl module of which pyXLWrtiter is a
docs-free port? Right down the end it mutters something about XML
parsers returning UTF8 which will jam up the works if fed into an
Excel spreadsheet ...


Looking at the following function in pyXLWriter
def _asc2ucs(s):
"""Convert ascii string to unicode."""
return "\x00".join (s) + "\x00"

I can guess several things:
a) pyXLWriter author is an ascii guy :)
b) unicode strings are not supported by pyXLWriter
c) excel keeps unicode text in utf-16le

Ksenia, try encoding unicode strings in utf-16le before passing them to
pyXLWriter . If that doesn't work that means pyXLWriter requires
changes to support unicode strings.

Serge.
Jul 18 '05 #6

Serge Orlov wrote:
Looking at the following function in pyXLWriter
def _asc2ucs(s):
"""Convert ascii string to unicode."""
return "\x00".join (s) + "\x00"

I can guess several things:
a) pyXLWriter author is an ascii guy :)
Shrewd guess :-)
b) unicode strings are not supported by pyXLWriter
But that _asc2ucs() is used ONLY in write_url* methods ... so there's
hope yet.
c) excel keeps unicode text in utf-16le
Uh-huh. MS-everything is LE.

Ksenia, try encoding unicode strings in utf-16le before passing them to pyXLWriter . If that doesn't work that means pyXLWriter requires
changes to support unicode strings.

Serge.


Jul 18 '05 #7
John, Serge, thanks for your help!

utf-16le encoding didn't help. I had however to solve it yesterday,
so I used csv module to create CSV file and then import it in Excel.
Excel still had troubles with accented characters, but this is another
story: it seems that Office 2004 Excel (for Mac, but I assume the PC
version is no better) cannot import UTF-8 encoded text files. Encoding
CSV file with Latin1 encoding finally did work.

Now back to the Excel story, I also think that there is something
wrong with pyExcelWriter or the way I use it. CSV file generation was
okay, so I think there is nothing wrong with my data, or XML parser.

I will resume in a few days with pyExcelWriter and will post the
results here, but anyway, many thanks for your time and explanation!
--
Ksenia
Jul 18 '05 #8

Ksenia Marasanova wrote:
John, Serge, thanks for your help!

utf-16le encoding didn't help. I had however to solve it yesterday,
so I used csv module to create CSV file and then import it in Excel.
Excel still had troubles with accented characters, but this is another story: it seems that Office 2004 Excel (for Mac, but I assume the PC
version is no better) cannot import UTF-8 encoded text files.
Right, I tried on windows xp, utf-8 csv file is imported as garbadge.
However, csv file saved in utf-16 encoding is imported correctly.
Encoding
CSV file with Latin1 encoding finally did work.

Now back to the Excel story, I also think that there is something
wrong with pyExcelWriter or the way I use it. CSV file generation was
okay, so I think there is nothing wrong with my data, or XML parser.

I will resume in a few days with pyExcelWriter and will post the
results here, but anyway, many thanks for your time and explanation!


I believe Microsoft Office has gone through byte strings to unicode
strings transformation between 1995 and 1997. I still remember times
when you could receive Microsoft Office file and couldn't view it.
I suspect pyExcelWriter writes strings in that old format so utf-16le
trick didn't work. You can try to contact pyExcelWriter author
and ask him about unicode support.

Serge.

Jul 18 '05 #9
Ksenia Marasanova wrote:
John, Serge, thanks for your help!
Thank *you* for having interesting problems :-)

utf-16le encoding didn't help. I had however to solve it yesterday,
so I used csv module to create CSV file and then import it in Excel.
Excel still had troubles with accented characters, but this is another story: it seems that Office 2004 Excel (for Mac, but I assume the PC
version is no better) cannot import UTF-8 encoded text files. Encoding CSV file with Latin1 encoding finally did work.
Yes, Excel appears not to understand UTF-8. It interprets CSV files
according to the current locale / codepage / whatever -- the "old bad
way" that Unicode is meant to save us from.

An alternative, if you need to represent more than one codepage, or
want a "new good way" of doing it: Excel allows "Save As" to "Unicode
Text" format. It uses Unicode tab u'\t' as delimiter. It quotes tabs,
quotes quotes by doubling them, and [weirdly] also quotes cells which
have only a comma [maybe locale-dependent] in them. It quite happily
opens such files without data loss. You should be able to make such
files easily with Python.

Here's a dump of such a file created by Excel 2002 on Windows -- pls
pardon any Cyrillic spelling errors :-)
file('C:/junk/km_u16.txt', 'rb').read().de code('utf16') u'\u041c\u0430\ u0440\u0430\u04 41\u0430\u043d\ u043e\u0432\u04 30\t\u041a\u044 1\u0435\u043d\u 044f\r\n"comma,
comma, comma"\t\r\n"qu ote ""Hello UniWorld""
unquote"\t\r\n" tab\ttab"\t\r\n '
print file('C:/junk/km_u16.txt', 'rb').read().de code('utf16') Марасан ва Ксеня

"comma, comma, comma"

"quote ""Hello UniWorld"" unquote"

"tab tab"

To make such a file, you would need a quoter function something like
this; you would apply it to each field:
def unitextquoter(s , quote=u'"', alt_delim=u',') : ! if quote in s:
! return quote + s.replace(quote , quote+quote) + quote
! if alt_delim in s or u'\t' in s:
! return quote + s + quote
! return s
unitextquoter(u 'comma, comma, comma') u'"comma, comma, comma"' unitextquoter(u 'tab\ttab') u'"tab\ttab"' unitextquoter(u 'quote "Hello UniWorld" unquote') u'"quote ""Hello UniWorld"" unquote"'


Then you would do u'\t'.join(fiel ds) , add on u'\r\n' [or whatever is
needed in your environment], .encode('utf16' ) and .write() to your 'wb'
file.

Now back to the Excel story, I also think that there is something
wrong with pyExcelWriter or the way I use it. CSV file generation was
okay, so I think there is nothing wrong with my data, or XML parser.

I will resume in a few days with pyExcelWriter and will post the
results here, but anyway, many thanks for your time and explanation!


I've been reading the source and looking at the Excel file specs
[available from openoffice.org if you're very short of reading
material!]. Apparently pyXLWriter doesn't handle Unicode at all.
Although Unicode came in with Excel 1997 (BIFF8 format file),
pyXLWriter appears to support only Excel 5(?) (BIFF5 format file). As
Serge suggested, appeal to the porter to appeal to the author of the
Perl module it's ported from; but don't hold your breath in the
meantime.

Cheers,
John

Jul 18 '05 #10

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

Similar topics

13
6141
by: Dan V. | last post by:
How do I create a one line text file with these control codes? e.g.: 144 = 0x90 and 147 = 0x93? I am trying to create a one line text file with these characters all one one row with no spaces. 1. 144 = 0x90 2. 147 = 0x93 3. STX = (^B = 2 = 0x2) 4. NUL = (^@ = 0 = 0x0)
3
1798
by: anand | last post by:
hi, let: dataSet1 is having some data from database. dataView1 = dataSet1.table(0).defaultView dataGrid1.dataSource = dataView1 dataGrid1.TableStyle.add(myTableStyle1)
3
3492
by: Thilaka | last post by:
Have created a table with different fields which includes date as one fields when i executed the following query, i am not getting the data whose date is less than the specified date. SELECT * FROM shiftdetails WHERE format(Date_of_Shift,'mm/dd/yyyy')<'1/1/2007' ORDER BY . DESC;
9
3455
by: nickyeng | last post by:
Hi My case is i get the error on runtime while getting data from a file. i get this error: Record of 12344 is found! 5 testing 4272 _cygtls::handle_exceptions: Error while dumping state (probably corrupted stack) Segmentation fault (core dumped)
7
2139
blazedaces
by: blazedaces | last post by:
Alright, so I racked my brain over this problem and thought maybe I could work with it kind of like FileDialog seems to work in that you create a new FileDialog(variables needed) and then after it runs (after you setVisible(true)) you can call something to get the information that was stored inside like this: fd.getDirectory()... So I tried something like that here: public static void main(String args) { ArrayList<String> temp...
4
2049
by: dfent | last post by:
I'm using MS Access 2003 1 form with 7 sub forms, updating 7 tables. I've split my database but still getting data changes error messages when multiple people are in the database. Any help would be greatly appreciated. Thanks.
6
3335
by: bushwacker | last post by:
Hello all, I'm a chemical engineering student. our teacher has given us a project to do some calculations based on some equations. those equations include constants, which are to be read from a file(I don't understand why?) i took an introductory course on c programming but the curriculum didn't include opening files, searching files and getting data from files. i made some searching through google and learned about opening and closing files,...
5
6660
by: abhi3211 | last post by:
i am using java inside java script page. in that page i want to use two dropdown list. in first dropdown list i am getting data from ms-access database. in second dropdown list i want to get data according to selection made in first dropdown list and it will also come from ms-access database.(for example if i am selecting country as india in first dropdown list then in second dropdown list will show states of india) the problem is that i...
8
2524
by: Innocent2104 | last post by:
Hi there, The script below displays the attached output but as shown, it skips certain days and i need to include these to calculate my avg balance for a certain month, i.e.Nov. How do i update the script to include for example between 01 Nov and 05 Nov, there was no entries, therefore my balance should remain the same & display my missing dates 02,03,04 Nov?? DECLARE @STARTDATE DATETIME, @ENDDATE DATETIME SET @STARTDATE = '2009-11-01' ...
0
9554
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
10136
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9989
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9925
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9811
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3913
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3509
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2788
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.